From 1fa42f5e116b19555cc59f7f5c49c50d0e948008 Mon Sep 17 00:00:00 2001 From: jeremy-then Date: Wed, 29 May 2024 23:53:56 -0400 Subject: [PATCH] Increase waitForBlock waiting time and attempts --- lib/rsk-utils-legacy.js | 2 +- lib/rsk-utils.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rsk-utils-legacy.js b/lib/rsk-utils-legacy.js index 4639d61..6a7c1cc 100644 --- a/lib/rsk-utils-legacy.js +++ b/lib/rsk-utils-legacy.js @@ -26,7 +26,7 @@ var waitForSync = (rskClients) => { }); }; -var waitForBlock = (rskClient, blockNumber, waitTime = 200, maxAttempts = 600) => { +var waitForBlock = (rskClient, blockNumber, waitTime = 500, maxAttempts = 600) => { return new Promise((resolve, reject) => { var clearPoll; var attempts = 0; diff --git a/lib/rsk-utils.js b/lib/rsk-utils.js index 5de39e2..ae08034 100644 --- a/lib/rsk-utils.js +++ b/lib/rsk-utils.js @@ -49,7 +49,7 @@ const waitForSync = async (rskTransactionHelpers) => { * @param {Number} maxAttempts defaults to 80 attempts by block. * @returns {Promise} the latest block number the same or greater than `blockNumber`. */ -const waitForBlock = (rskClient, blockNumber, waitTime = 200, maxAttempts = 80) => { +const waitForBlock = (rskClient, blockNumber, waitTime = 500, maxAttempts = 160) => { return new Promise((resolve, reject) => { let attempts = 1; let latestBlockNumber = -1;