diff options
author | João Barbosa <joao.paulo.barbosa@gmail.com> | 2020-06-15 22:57:57 +0100 |
---|---|---|
committer | João Barbosa <joao.paulo.barbosa@gmail.com> | 2020-08-17 00:06:02 +0100 |
commit | a13cafc6c6998baedf3c5766259c21fcd763b99e (patch) | |
tree | a971c5150941f70f02a5517852f0f5b44c3ae6c2 /src/wallet/wallet.cpp | |
parent | ffad34816722cdf27a0a7c16539ddd1d655602e0 (diff) |
wallet: GetWalletTx requires cs_wallet lock
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r-- | src/wallet/wallet.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 9c7b446c23..080010d12f 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -276,7 +276,7 @@ std::string COutput::ToString() const const CWalletTx* CWallet::GetWalletTx(const uint256& hash) const { - LOCK(cs_wallet); + AssertLockHeld(cs_wallet); std::map<uint256, CWalletTx>::const_iterator it = mapWallet.find(hash); if (it == mapWallet.end()) return nullptr; @@ -1983,6 +1983,7 @@ bool CWalletTx::IsTrusted(std::set<uint256>& trusted_parents) const if (!InMempool()) return false; // Trusted if all inputs are from us and are in the mempool: + LOCK(pwallet->cs_wallet); for (const CTxIn& txin : tx->vin) { // Transactions not sent by us: not trusted |