don't prefetch txns

This commit is contained in:
MrTuxedo 2023-04-22 19:37:10 -07:00
parent f78674578b
commit d9de65911b
2 changed files with 7 additions and 3 deletions

View File

@ -12,7 +12,7 @@ const provider = new WebSocketProvider(rpcUrl);
const blockBaseFeePerGasObservable$ = new Observable<number>((observer) => {
provider.on('block', async (blockNumber) => {
try {
const { baseFeePerGas } = await provider.getBlock(blockNumber, true) || {};
const { baseFeePerGas } = await provider.getBlock(blockNumber) || {};
if (!baseFeePerGas) throw new Error(`Error fetching block! ${blockNumber}`);

View File

@ -82,7 +82,11 @@ client.login(token)
await redisClient.set('current-prices', JSON.stringify(averageGasPrices))
await doAlerts(averageGasPrices);
},
error: console.error,
error: (err) => console.error(err),
complete: () => console.log("Blockchain data stream closed")
})
});
})
.catch(
(err) => console.log(`Bot runtime error!
${err}`)
);