aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
authorJoão Barbosa <joao.paulo.barbosa@gmail.com>2020-06-15 23:03:17 +0100
committerJoão Barbosa <joao.paulo.barbosa@gmail.com>2020-08-17 00:06:03 +0100
commitd8441f30ff57e4ae98cff6694c995eaffc19c51a (patch)
tree2aa1996402d0dcfd410462caad5eb2db0f323844 /src/interfaces
parenta13cafc6c6998baedf3c5766259c21fcd763b99e (diff)
downloadbitcoin-d8441f30ff57e4ae98cff6694c995eaffc19c51a.tar.xz
wallet: IsMine overloads require cs_wallet lock
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/wallet.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/interfaces/wallet.cpp b/src/interfaces/wallet.cpp
index 7fd24425cf..937e602fb0 100644
--- a/src/interfaces/wallet.cpp
+++ b/src/interfaces/wallet.cpp
@@ -37,6 +37,7 @@ namespace {
//! Construct wallet tx struct.
WalletTx MakeWalletTx(CWallet& wallet, const CWalletTx& wtx)
{
+ LOCK(wallet.cs_wallet);
WalletTx result;
result.tx = wtx.tx;
result.txin_is_mine.reserve(wtx.tx->vin.size());
@@ -132,7 +133,11 @@ public:
{
return m_wallet->SignMessage(message, pkhash, str_sig);
}
- bool isSpendable(const CTxDestination& dest) override { return m_wallet->IsMine(dest) & ISMINE_SPENDABLE; }
+ bool isSpendable(const CTxDestination& dest) override
+ {
+ LOCK(m_wallet->cs_wallet);
+ return m_wallet->IsMine(dest) & ISMINE_SPENDABLE;
+ }
bool haveWatchOnly() override
{
auto spk_man = m_wallet->GetLegacyScriptPubKeyMan();