mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-11-12 18:37:25 +00:00
Remove transactions from the dead pool when they become live, and from pending when they become dead. Addresses comments from Miron.
This commit is contained in:
@@ -842,6 +842,7 @@ public class Wallet implements Serializable {
|
|||||||
TransactionOutput doubleSpent = input.getConnectedOutput(pool);
|
TransactionOutput doubleSpent = input.getConnectedOutput(pool);
|
||||||
Transaction replacement = doubleSpent.getSpentBy().parentTransaction;
|
Transaction replacement = doubleSpent.getSpentBy().parentTransaction;
|
||||||
dead.put(tx.getHash(), tx);
|
dead.put(tx.getHash(), tx);
|
||||||
|
pending.remove(tx.getHash());
|
||||||
// Inform the event listeners of the newly dead tx.
|
// Inform the event listeners of the newly dead tx.
|
||||||
for (WalletEventListener listener : eventListeners) {
|
for (WalletEventListener listener : eventListeners) {
|
||||||
synchronized (listener) {
|
synchronized (listener) {
|
||||||
@@ -860,6 +861,7 @@ public class Wallet implements Serializable {
|
|||||||
// All inputs are either valid for spending or don't come from us. Miners are trying to reinclude it.
|
// All inputs are either valid for spending or don't come from us. Miners are trying to reinclude it.
|
||||||
log.info(" ->pending", tx.getHashAsString());
|
log.info(" ->pending", tx.getHashAsString());
|
||||||
pending.put(tx.getHash(), tx);
|
pending.put(tx.getHash(), tx);
|
||||||
|
dead.remove(tx.getHash());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user