Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Commit

Permalink
Merge pull request #78 from makerdao/txobj-wait-fix
Browse files Browse the repository at this point in the history
remove redundant wait in _getTransactionData
  • Loading branch information
levity authored Jan 16, 2019
2 parents 5aca310 + f969754 commit 56177df
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/eth/TransactionObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,10 @@ export default class TransactionObject extends TransactionLifeCycle {
}
this.setPending(); // set state to pending

// when you're on a local testnet, a single call to getTransaction should
// be enough. but on a remote net, it may take multiple calls.
for (let i = 0; i < 10; i++) {
tx = await this._web3Service.getTransaction(this.hash);
if (tx) break;
log('no tx yet');
await promiseWait(1500);
}

if (!tx) {
throw new Error('Tried getTransaction 10 times and still failed');
}

// when you're on a local testnet, the transaction will probably already
// be mined by this point. but on other nets, you still have to wait for
// it to be mined.
if (!tx.blockHash) {
if (!tx || !tx.blockHash) {
tx = await this._keepWaitingForTx();
}

Expand Down

0 comments on commit 56177df

Please sign in to comment.