Skip to content

Commit

Permalink
Fix missing registration of PeerTransactionTracker to dropped tx noti…
Browse files Browse the repository at this point in the history
…fications (#7858)

Signed-off-by: Fabio Di Fabio <[email protected]>
  • Loading branch information
fab-10 authored Nov 8, 2024
1 parent e17ebc5 commit 62b2c50
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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<TransactionType> ANNOUNCE_HASH_ONLY_TX_TYPES = EnumSet.of(BLOB);
Expand Down Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public TransactionPool(
subscribePendingTransactions(this::mapBlobsOnTransactionAdded);
subscribeDroppedTransactions(
(transaction, reason) -> unmapBlobsOnTransactionDropped(transaction));
subscribeDroppedTransactions(transactionBroadcaster);
}

private void initLogForReplay() {
Expand Down

0 comments on commit 62b2c50

Please sign in to comment.