aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Morcos <morcos@chaincode.com>2016-01-06 17:24:30 -0500
committerWladimir J. van der Laan <laanwj@gmail.com>2016-01-08 17:38:04 +0100
commit4707797df2d41d46a40f59977738e58f87a949fe (patch)
tree33831918892d5e99e49863e8b00cac220a818f6b
parent9265e89a7778d37065f7018979d75805073b41c6 (diff)
downloadbitcoin-4707797df2d41d46a40f59977738e58f87a949fe.tar.xz
Make sure conflicted wallet tx's update balances
Github-Pull: #7306 Rebased-From: f61766b37beb2fecbe3915a72a814cbdb107be0a
-rw-r--r--src/wallet/wallet.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index b8ed10c844..5d03ce3283 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -811,6 +811,13 @@ void CWallet::MarkConflicted(const uint256& hashBlock, const uint256& hashTx)
}
iter++;
}
+ // If a transaction changes 'conflicted' state, that changes the balance
+ // available of the outputs it spends. So force those to be recomputed
+ BOOST_FOREACH(const CTxIn& txin, wtx.vin)
+ {
+ if (mapWallet.count(txin.prevout.hash))
+ mapWallet[txin.prevout.hash].MarkDirty();
+ }
}
}
}