don't do too much work when transaction pool is disabled (#7753)

Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net>
pull/7750/head
Stefan Pingel 1 month ago committed by GitHub
parent efb6906e13
commit f9bed5930c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/NewPooledTransactionHashesMessageHandler.java
  2. 5
      ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionsMessageHandler.java

@ -45,11 +45,11 @@ class NewPooledTransactionHashesMessageHandler implements EthMessages.MessageCal
@Override
public void exec(final EthMessage message) {
final Capability capability = message.getPeer().getConnection().capability(EthProtocol.NAME);
final NewPooledTransactionHashesMessage transactionsMessage =
NewPooledTransactionHashesMessage.readFrom(message.getData(), capability);
final Instant startedAt = now();
if (isEnabled.get()) {
final Capability capability = message.getPeer().getConnection().capability(EthProtocol.NAME);
final NewPooledTransactionHashesMessage transactionsMessage =
NewPooledTransactionHashesMessage.readFrom(message.getData(), capability);
final Instant startedAt = now();
scheduler.scheduleTxWorkerTask(
() ->
transactionsMessageProcessor.processNewPooledTransactionHashesMessage(

@ -43,9 +43,10 @@ class TransactionsMessageHandler implements EthMessages.MessageCallback {
@Override
public void exec(final EthMessage message) {
final TransactionsMessage transactionsMessage = TransactionsMessage.readFrom(message.getData());
final Instant startedAt = now();
if (isEnabled.get()) {
final TransactionsMessage transactionsMessage =
TransactionsMessage.readFrom(message.getData());
final Instant startedAt = now();
scheduler.scheduleTxWorkerTask(
() ->
transactionsMessageProcessor.processTransactionsMessage(

Loading…
Cancel
Save