Skip to content

Commit

Permalink
Handle async errors when using fallback connections to send raw tx. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
richardwu committed Jul 5, 2022
1 parent e5f2a37 commit 710c2fe
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions packages/solana-contrib/src/broadcaster/tiered.ts
Expand Up @@ -70,12 +70,16 @@ export class TieredBroadcaster implements Broadcaster {
void (async () => {
await Promise.all(
this.fallbackConnections.map(async (fc) => {
await sendAndSpamRawTx(
fc,
encoded,
options ?? this.opts,
options?.fallbackRetryOptions ?? DEFAULT_FALLBACK_RETRY_OPTIONS
);
try {
await sendAndSpamRawTx(
fc,
encoded,
options ?? this.opts,
options?.fallbackRetryOptions ?? DEFAULT_FALLBACK_RETRY_OPTIONS
);
} catch (e) {
console.warn(`[Broadcaster] _sendRawTransaction error`, e);
}
})
);
})();
Expand Down

0 comments on commit 710c2fe

Please sign in to comment.