Skip to content

Commit

Permalink
Returns early while checking bitcoin mempool
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-then committed Dec 11, 2023
1 parent e286330 commit 5e168aa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ const waitForBtcTxToBeInMempool = async (btcTxHelper, btcTxHash) => {
console.debug(`The btc tx (${btcTxHash}) was already mined.`);
return true;
}
} else {
return true;
}
};

Expand Down Expand Up @@ -275,12 +277,11 @@ const waitForBtcMempoolToGetTxs = async (btcTxHelper) => {

const initialBitcoinMempoolSize = (await getBitcoinMempool(btcTxHelper)).length;

console.debug(`The initial btc mempool size is ${initialBitcoinMempoolSize}.`);
console.debug(`[waitForBtcMempoolToGetTxs] The initial btc mempool size is ${initialBitcoinMempoolSize}.`);

const getBitcoinMempoolSize = async () => {
const bitcoinMempool = await getBitcoinMempool(btcTxHelper);
const bitcoinMempoolSize = bitcoinMempool.length;
console.debug(`The btc mempool has ${bitcoinMempoolSize} txs.`);
return bitcoinMempoolSize;
};

Expand Down

0 comments on commit 5e168aa

Please sign in to comment.