diff --git a/ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/transactions/PendingTransactions.java b/ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/transactions/PendingTransactions.java index 4db8e21759..93c5cc0386 100644 --- a/ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/transactions/PendingTransactions.java +++ b/ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/transactions/PendingTransactions.java @@ -105,7 +105,7 @@ public PendingTransactions( timerUtil.setPeriodic(transactionEvictionIntervalMs, this::evictOldTransactions); } - private boolean filterStream(TransactionInfo transaction) { + private boolean applyEvictionThreshold(final TransactionInfo transaction) { final long now = System.currentTimeMillis(); return now - transaction.getAddedToPoolAt().getEpochSecond() > transactionEvictionIntervalMs; } @@ -113,7 +113,7 @@ private boolean filterStream(TransactionInfo transaction) { private void evictOldTransactions() { synchronized (pendingTransactions) { final List transactionsToRemove = - prioritizedTransactions.stream().filter(this::filterStream).collect(toList()); + prioritizedTransactions.stream().filter(this::applyEvictionThreshold).collect(toList()); transactionsToRemove.forEach(transaction -> removeTransaction(transaction.getTransaction())); } }