diff --git a/crates/transaction-pool/src/pool/best.rs b/crates/transaction-pool/src/pool/best.rs index e6dabc7328..52c0e26f97 100644 --- a/crates/transaction-pool/src/pool/best.rs +++ b/crates/transaction-pool/src/pool/best.rs @@ -49,7 +49,8 @@ impl Iterator for BestTransactions { fn next(&mut self) -> Option { loop { // Remove the next independent tx with the highest priority - let best = self.independent.pop_last()?; + let best = self.independent.iter().next_back()?.clone(); + let best = self.independent.take(&best)?; let hash = best.transaction.hash(); // skip transactions that were marked as invalid