diff options
| author | Cozz Lovan <[email protected]> | 2014-03-09 12:41:22 +0100 |
|---|---|---|
| committer | Ross Nicoll <[email protected]> | 2014-05-18 16:51:16 +0100 |
| commit | d7b38f956ff5edabb2afaed6222750107ad81f0c (patch) | |
| tree | 41d9da93bec9b853e0910fd0eb57cd37a081cb61 /src/wallet.cpp | |
| parent | minor style cleanups (diff) | |
| download | discoin-d7b38f956ff5edabb2afaed6222750107ad81f0c.tar.xz discoin-d7b38f956ff5edabb2afaed6222750107ad81f0c.zip | |
Fix missing wallet lock in CWallet::SyncTransaction(..)
Diffstat (limited to 'src/wallet.cpp')
| -rw-r--r-- | src/wallet.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp index feeee86ce..8fab1f08b 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -591,7 +591,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet) bool CWallet::AddToWalletIfInvolvingMe(const uint256 &hash, const CTransaction& tx, const CBlock* pblock, bool fUpdate) { { - LOCK(cs_wallet); + AssertLockHeld(cs_wallet); bool fExisted = mapWallet.count(hash); if (fExisted && !fUpdate) return false; if (fExisted || IsMine(tx) || IsFromMe(tx)) @@ -608,9 +608,8 @@ bool CWallet::AddToWalletIfInvolvingMe(const uint256 &hash, const CTransaction& void CWallet::SyncTransaction(const uint256 &hash, const CTransaction& tx, const CBlock* pblock) { - AddToWalletIfInvolvingMe(hash, tx, pblock, true); - - if (mapWallet.count(hash) == 0) + LOCK(cs_wallet); + if (!AddToWalletIfInvolvingMe(hash, tx, pblock, true)) return; // Not one of ours // If a transaction changes 'conflicted' state, that changes the balance |