Skip to content

Commit

Permalink
Alternative synchonization of signalInvalidAndRemoveDependentTransact…
Browse files Browse the repository at this point in the history
…ions

Signed-off-by: Fabio Di Fabio <[email protected]>
  • Loading branch information
fab-10 authored and vdamle committed Jun 20, 2023
1 parent df3bf97 commit 0e2a262
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,9 @@ public List<Transaction> signalInvalidAndGetDependentTransactions(final Transact

@Override
public void signalInvalidAndRemoveDependentTransactions(final Transaction transaction) {
signalInvalidAndGetDependentTransactions(transaction).forEach(this::removeTransaction);
synchronized (lock) {
signalInvalidAndGetDependentTransactions(transaction).forEach(this::removeTransaction);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@ public List<PendingTransaction> getPendingTransactions(final long startingNonce)
}

public Stream<PendingTransaction> streamPendingTransactions() {
synchronized (pendingTransactions) {
return List.copyOf(pendingTransactions.values()).stream();
}
return pendingTransactions.values().stream();
}

public PendingTransaction getPendingTransactionForNonce(final long nonce) {
Expand Down

0 comments on commit 0e2a262

Please sign in to comment.