From 59ba97c7664c4b9d7cbe9d1e790230d76992525a Mon Sep 17 00:00:00 2001 From: Fabio Di Fabio Date: Tue, 5 Nov 2024 12:11:05 +0100 Subject: [PATCH] Fix missing registration of PeerTransactionTracker to dropped tx notifications Signed-off-by: Fabio Di Fabio --- .../ethereum/eth/transactions/TransactionBroadcaster.java | 8 +++++++- .../besu/ethereum/eth/transactions/TransactionPool.java | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionBroadcaster.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionBroadcaster.java index c60c064c4c2..35f438d4191 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionBroadcaster.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionBroadcaster.java @@ -37,7 +37,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class TransactionBroadcaster implements TransactionBatchAddedListener { +public class TransactionBroadcaster + implements TransactionBatchAddedListener, PendingTransactionDroppedListener { private static final Logger LOG = LoggerFactory.getLogger(TransactionBroadcaster.class); private static final EnumSet ANNOUNCE_HASH_ONLY_TX_TYPES = EnumSet.of(BLOB); @@ -219,4 +220,9 @@ private void movePeersBetweenLists( destinationList.add(sourceList.remove(i)); } } + + @Override + public void onTransactionDropped(final Transaction transaction, final RemovalReason reason) { + transactionTracker.onTransactionDropped(transaction, reason); + } } diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPool.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPool.java index 19bcfe0b36e..3acf49894a3 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPool.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPool.java @@ -139,6 +139,7 @@ public TransactionPool( subscribePendingTransactions(this::mapBlobsOnTransactionAdded); subscribeDroppedTransactions( (transaction, reason) -> unmapBlobsOnTransactionDropped(transaction)); + subscribeDroppedTransactions(transactionBroadcaster); } private void initLogForReplay() {