Skip to content

Commit

Permalink
prevent broadcasts but listen for all
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Aug 31, 2023
1 parent 16bec56 commit 332368c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/network-txpool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use reth_network::{config::rng_secret_key, NetworkConfig, NetworkManager};
use reth_provider::test_utils::NoopProvider;
use reth_transaction_pool::{
blobstore::InMemoryBlobStore, validate::ValidTransaction, CoinbaseTipOrdering,
EthPooledTransaction, PoolTransaction, TransactionOrigin, TransactionPool,
TransactionValidationOutcome, TransactionValidator,
EthPooledTransaction, PoolTransaction, TransactionListenerKind, TransactionOrigin,
TransactionPool, TransactionValidationOutcome, TransactionValidator,
};

#[tokio::main]
Expand Down Expand Up @@ -46,7 +46,7 @@ async fn main() -> eyre::Result<()> {
tokio::task::spawn(txpool);

// listen for new transactions
let mut txs = pool.pending_transactions_listener();
let mut txs = pool.pending_transactions_listener_for(TransactionListenerKind::All);

while let Some(tx) = txs.recv().await {
println!("Received new transaction: {:?}", tx);
Expand Down Expand Up @@ -81,7 +81,7 @@ impl TransactionValidator for OkValidator {
balance: transaction.cost(),
state_nonce: transaction.nonce(),
transaction: ValidTransaction::Valid(transaction),
propagate: true,
propagate: false,
}
}
}

0 comments on commit 332368c

Please sign in to comment.