mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-23 05:14:19 +00:00
Merge pull request #3849 from cozz/cozz2
Fix missing wallet lock in CWallet::SyncTransaction(..)
This commit is contained in:
commit
1e13f57f56
@ -589,7 +589,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet)
|
|||||||
bool CWallet::AddToWalletIfInvolvingMe(const uint256 &hash, const CTransaction& tx, const CBlock* pblock, bool fUpdate)
|
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);
|
bool fExisted = mapWallet.count(hash);
|
||||||
if (fExisted && !fUpdate) return false;
|
if (fExisted && !fUpdate) return false;
|
||||||
if (fExisted || IsMine(tx) || IsFromMe(tx))
|
if (fExisted || IsMine(tx) || IsFromMe(tx))
|
||||||
@ -606,9 +606,8 @@ bool CWallet::AddToWalletIfInvolvingMe(const uint256 &hash, const CTransaction&
|
|||||||
|
|
||||||
void CWallet::SyncTransaction(const uint256 &hash, const CTransaction& tx, const CBlock* pblock)
|
void CWallet::SyncTransaction(const uint256 &hash, const CTransaction& tx, const CBlock* pblock)
|
||||||
{
|
{
|
||||||
AddToWalletIfInvolvingMe(hash, tx, pblock, true);
|
LOCK(cs_wallet);
|
||||||
|
if (!AddToWalletIfInvolvingMe(hash, tx, pblock, true))
|
||||||
if (mapWallet.count(hash) == 0)
|
|
||||||
return; // Not one of ours
|
return; // Not one of ours
|
||||||
|
|
||||||
// If a transaction changes 'conflicted' state, that changes the balance
|
// If a transaction changes 'conflicted' state, that changes the balance
|
||||||
|
Loading…
x
Reference in New Issue
Block a user