fix: ensure we poll again (#19866)

This commit is contained in:
Matthias Seitz
2025-11-20 01:11:32 +01:00
committed by GitHub
parent c75dc322d9
commit 5b6ce8bd64

View File

@@ -1551,7 +1551,19 @@ where
SOFT_LIMIT_COUNT_HASHES_IN_NEW_POOLED_TRANSACTIONS_BROADCAST_MESSAGE,
) {
Poll::Ready(count) => {
count == SOFT_LIMIT_COUNT_HASHES_IN_NEW_POOLED_TRANSACTIONS_BROADCAST_MESSAGE
if count == SOFT_LIMIT_COUNT_HASHES_IN_NEW_POOLED_TRANSACTIONS_BROADCAST_MESSAGE {
// we filled the entire buffer capacity and need to try again on the next poll
// immediately
true
} else {
// try once more, because mostlikely the channel is now empty and the waker is
// registered if this is pending, if we filled additional hashes, we poll again
// on the next iteration
let limit =
SOFT_LIMIT_COUNT_HASHES_IN_NEW_POOLED_TRANSACTIONS_BROADCAST_MESSAGE -
new_txs.len();
this.pending_transactions.poll_recv_many(cx, &mut new_txs, limit).is_ready()
}
}
Poll::Pending => false,
};