bug: reschedule rewaking when unpausing pending tx future (#50)
This commit is contained in:
parent
320ab276de
commit
6f02bb5436
|
@ -68,7 +68,8 @@ impl<'a, P: JsonRpcClient> Future for PendingTransaction<'a, P> {
|
||||||
// new block has been mined
|
// new block has been mined
|
||||||
let _ready = futures_util::ready!(this.interval.poll_next_unpin(ctx));
|
let _ready = futures_util::ready!(this.interval.poll_next_unpin(ctx));
|
||||||
let fut = Box::pin(this.provider.get_transaction_receipt(*this.tx_hash));
|
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) => {
|
PendingTxState::GettingReceipt(fut) => {
|
||||||
if let Ok(receipt) = futures_util::ready!(fut.as_mut().poll(ctx)) {
|
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
|
// we poll again
|
||||||
let fut = Box::pin(this.provider.get_block_number());
|
let fut = Box::pin(this.provider.get_block_number());
|
||||||
*this.state = PendingTxState::GettingBlockNumber(fut, receipt.clone());
|
*this.state = PendingTxState::GettingBlockNumber(fut, receipt.clone());
|
||||||
return Poll::Pending;
|
ctx.waker().wake_by_ref();
|
||||||
}
|
}
|
||||||
PendingTxState::GettingBlockNumber(fut, receipt) => {
|
PendingTxState::GettingBlockNumber(fut, receipt) => {
|
||||||
// Wait for the interval
|
// Wait for the interval
|
||||||
|
|
Loading…
Reference in New Issue