Skip to content

Commit

Permalink
Add lock to creation of pending transaction stream
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Whitehead <[email protected]>
  • Loading branch information
matthew1001 authored and vdamle committed Jun 20, 2023
1 parent 67db8de commit df3bf97
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ public List<PendingTransaction> getPendingTransactions(final long startingNonce)
}

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

public PendingTransaction getPendingTransactionForNonce(final long nonce) {
Expand Down

0 comments on commit df3bf97

Please sign in to comment.