Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Commit

Permalink
fix: Misleading bundle inclusion (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
chikko80 authored May 19, 2023
1 parent e85fdcf commit 3c39811
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/pending_bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,11 @@ impl<'a, P: JsonRpcClient> Future for PendingBundle<'a, P> {
return Poll::Pending;
}

// Check if the bundle transactions are present in the block
// Since a bundle cannot be divided, we only need to check
// if the first transaction was included.
//
// Note: The indexed access is safe, since empty bundles
// (i.e. bundles with no transactions) cannot be submitted.
let included = block
// Check if all transactions of the bundle are present in the block
let included: bool = this
.transactions
.iter()
.any(|tx_hash| *tx_hash == this.transactions[0]);
.all(|tx_hash| block.transactions.contains(tx_hash));

*this.state = PendingBundleState::Completed;
if included {
Expand Down

0 comments on commit 3c39811

Please sign in to comment.