Fix ConcurrentModificationException in getCachedSigValidTransactions()

This commit is contained in:
CalDescent 2022-05-27 10:15:41 +02:00
parent 8e71cbd822
commit 0875c5bf3b

View File

@ -99,11 +99,13 @@ public class TransactionImporter extends Thread {
* @return a list of TransactionData objects, with valid signatures. * @return a list of TransactionData objects, with valid signatures.
*/ */
private List<TransactionData> getCachedSigValidTransactions() { private List<TransactionData> getCachedSigValidTransactions() {
synchronized (this.incomingTransactions) {
return this.incomingTransactions.entrySet().stream() return this.incomingTransactions.entrySet().stream()
.filter(t -> Boolean.TRUE.equals(t.getValue())) .filter(t -> Boolean.TRUE.equals(t.getValue()))
.map(Map.Entry::getKey) .map(Map.Entry::getKey)
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
}
/** /**
* Validate the signatures of any transactions pending import, then update their * Validate the signatures of any transactions pending import, then update their