mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-11-03 05:57:21 +00:00
Unlock TransactionConfidence event listeners, make sure MemoryPool is not locked when a tx is marked broadcast by a peer to avoid inversions via listeners.
Unfortunately this introduces some new FindBugs warnings because it doesn't understand the inside-out locking pattern used here, despite that it's correct. Update issue 233.
This commit is contained in:
@@ -120,6 +120,7 @@ public class PingService {
|
||||
": " + tx);
|
||||
tx.getConfidence().addEventListener(new TransactionConfidence.Listener() {
|
||||
public void onConfidenceChanged(Transaction tx2) {
|
||||
// Must be thread safe.
|
||||
if (tx2.getConfidence().getConfidenceType() == TransactionConfidence.ConfidenceType.BUILDING) {
|
||||
// Coins were confirmed (appeared in a block).
|
||||
tx2.getConfidence().removeEventListener(this);
|
||||
|
||||
Reference in New Issue
Block a user