From 9508117c44d1ce993e7d154e283ba9e8487a806c Mon Sep 17 00:00:00 2001 From: James Prestwich Date: Fri, 10 Jul 2020 10:38:21 -0700 Subject: [PATCH] bug: reschedule rewaking when unpausing pending tx future --- ethers-providers/src/pending_transaction.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ethers-providers/src/pending_transaction.rs b/ethers-providers/src/pending_transaction.rs index 9692aa011..1b4a89337 100644 --- a/ethers-providers/src/pending_transaction.rs +++ b/ethers-providers/src/pending_transaction.rs @@ -68,7 +68,8 @@ impl<'a, P: JsonRpcClient> Future for PendingTransaction<'a, P> { // new block has been mined let _ready = futures_util::ready!(this.interval.poll_next_unpin(ctx)); let fut = Box::pin(this.provider.get_transaction_receipt(*this.tx_hash)); - *this.state = PendingTxState::GettingReceipt(fut) + *this.state = PendingTxState::GettingReceipt(fut); + ctx.waker().wake_by_ref(); } PendingTxState::GettingReceipt(fut) => { if let Ok(receipt) = futures_util::ready!(fut.as_mut().poll(ctx)) { @@ -102,7 +103,7 @@ impl<'a, P: JsonRpcClient> Future for PendingTransaction<'a, P> { // we poll again let fut = Box::pin(this.provider.get_block_number()); *this.state = PendingTxState::GettingBlockNumber(fut, receipt.clone()); - return Poll::Pending; + ctx.waker().wake_by_ref(); } PendingTxState::GettingBlockNumber(fut, receipt) => { // Wait for the interval