From 6f02bb54365f5a786db1214497b9d1ebf8304995 Mon Sep 17 00:00:00 2001 From: James Prestwich <10149425+prestwich@users.noreply.github.com> Date: Mon, 13 Jul 2020 10:52:33 -0700 Subject: [PATCH] bug: reschedule rewaking when unpausing pending tx future (#50) --- 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 9692aa01..1b4a8933 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