Fixed 0 confirmation waiting (#346).
This commit is contained in:
parent
24757f1064
commit
048c571d3d
@ -751,8 +751,9 @@ export class BaseProvider extends Provider {
|
|||||||
if (confirmations == null) { confirmations = 1; }
|
if (confirmations == null) { confirmations = 1; }
|
||||||
return poll(() => {
|
return poll(() => {
|
||||||
return this.getTransactionReceipt(transactionHash).then((receipt) => {
|
return this.getTransactionReceipt(transactionHash).then((receipt) => {
|
||||||
if (receipt == null && confirmations !== 0) {
|
if (confirmations === 0) { return receipt; }
|
||||||
if (receipt.confirmations < confirmations) { return undefined; }
|
if (receipt == null || receipt.confirmations < confirmations) {
|
||||||
|
return undefined;
|
||||||
}
|
}
|
||||||
return receipt;
|
return receipt;
|
||||||
});
|
});
|
||||||
@ -874,6 +875,7 @@ export class BaseProvider extends Provider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return this.waitForTransaction(tx.hash, confirmations).then((receipt) => {
|
return this.waitForTransaction(tx.hash, confirmations).then((receipt) => {
|
||||||
|
if (receipt == null && confirmations === 0) { return null; }
|
||||||
|
|
||||||
// No longer pending, allow the polling loop to garbage collect this
|
// No longer pending, allow the polling loop to garbage collect this
|
||||||
this._emitted['t:' + tx.hash] = receipt.blockNumber;
|
this._emitted['t:' + tx.hash] = receipt.blockNumber;
|
||||||
|
Loading…
Reference in New Issue
Block a user