Skip to content

Commit

Permalink
use specific connection for bulkaccountloader
Browse files Browse the repository at this point in the history
  • Loading branch information
wphan committed Dec 2, 2023
1 parent 1985f23 commit d77b870
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,6 @@ const runBot = async () => {
commitment: stateCommitment,
});

const sendTxConnection = new Connection(endpoint, {
wsEndpoint: wsEndpoint,
commitment: stateCommitment,
disableRetryOnRateLimit: true,
});

let bulkAccountLoader: BulkAccountLoader | undefined;
let lastBulkAccountLoaderSlot: number | undefined;
let accountSubscription: DriftClientSubscriptionConfig = {
Expand All @@ -215,8 +209,13 @@ const runBot = async () => {
};

if (!config.global.websocket) {
const bulkAccountLoaderConnection = new Connection(endpoint, {
wsEndpoint: wsEndpoint,
commitment: stateCommitment,
disableRetryOnRateLimit: true,
});
bulkAccountLoader = new BulkAccountLoader(
connection,
bulkAccountLoaderConnection,
stateCommitment,
config.global.bulkAccountLoaderPollingInterval
);
Expand All @@ -236,6 +235,11 @@ const runBot = async () => {
skipPreflight: false,
preflightCommitment: stateCommitment,
};
const sendTxConnection = new Connection(endpoint, {
wsEndpoint: wsEndpoint,
commitment: stateCommitment,
disableRetryOnRateLimit: true,
});
const txSender = new FastSingleTxSender({
connection: sendTxConnection,
wallet,
Expand Down

0 comments on commit d77b870

Please sign in to comment.