From fcc06e682265dd74d187a20f601a14e913d826c9 Mon Sep 17 00:00:00 2001 From: "S. Matthew English" Date: Fri, 19 Apr 2019 21:36:10 -0400 Subject: [PATCH] x --- .../ethereum/eth/transactions/PendingTransactions.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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())); } }