Wallet: Fix bug in cleanup() that sometimes would put foreign outputs in myUnspents when disconnecting. This wrongly increases the balance.

This commit is contained in:
Andreas Schildbach
2016-03-05 01:04:22 +01:00
parent cf354feda2
commit 512d281d37

View File

@@ -2658,7 +2658,8 @@ public class Wallet extends BaseTaggableObject implements Serializable, BlockCha
for (TransactionInput input : tx.getInputs()) {
TransactionOutput output = input.getConnectedOutput();
if (output == null) continue;
myUnspents.add(output);
if (output.isMineOrWatched(this))
checkState(myUnspents.add(output));
input.disconnect();
}
for (TransactionOutput output : tx.getOutputs())