From abb600d837b2977b919194eb4c1ae60eafc1007b Mon Sep 17 00:00:00 2001 From: nicolas Date: Thu, 7 May 2020 17:21:55 -0300 Subject: [PATCH] improve calculation of TX mined (#886) --- src/routes/opening/index.jsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/routes/opening/index.jsx b/src/routes/opening/index.jsx index 791ade76..56809ea7 100644 --- a/src/routes/opening/index.jsx +++ b/src/routes/opening/index.jsx @@ -252,12 +252,17 @@ const SafeDeployment = ({ creationTxHash, onCancel, onRetry, onSuccess, provider const isTxMined = async (txHash) => { const web3 = getWeb3() + const txResult = await web3.eth.getTransaction(txHash) + if (txResult.blockNumber === null) { + return false + } + const receipt = await web3.eth.getTransactionReceipt(txHash) if (!receipt.status) { throw Error('TX status reverted') } - const txResult = await web3.eth.getTransaction(txHash) - return txResult.blockNumber !== null + + return true } let interval = setInterval(async () => {