3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-01-30 23:02:15 +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:
Mike Hearn 2011-06-27 19:56:37 +00:00
parent ca84bea462
commit 675abc2974

View File

@ -842,6 +842,7 @@ public class Wallet implements Serializable {
TransactionOutput doubleSpent = input.getConnectedOutput(pool);
Transaction replacement = doubleSpent.getSpentBy().parentTransaction;
dead.put(tx.getHash(), tx);
pending.remove(tx.getHash());
// Inform the event listeners of the newly dead tx.
for (WalletEventListener listener : eventListeners) {
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.
log.info(" ->pending", tx.getHashAsString());
pending.put(tx.getHash(), tx);
dead.remove(tx.getHash());
}
}