aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorJoão Barbosa <joao.paulo.barbosa@gmail.com>2020-08-29 15:29:00 +0100
committerJoão Barbosa <joao.paulo.barbosa@gmail.com>2021-09-03 18:30:01 +0100
commit5fabde6fadd1b07e981c97f5087d67c4179340ba (patch)
treec8134b2ec0a852dbf07c2c511396a158fad53c0d /src/wallet/wallet.cpp
parent32d036e8dab5f5b24096d9765236441e7b6a3b34 (diff)
downloadbitcoin-5fabde6fadd1b07e981c97f5087d67c4179340ba.tar.xz
wallet: AddWalletDescriptor requires cs_wallet lock
No change in behavior, the lock is already held at call sites.
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 1216bf5e08..70349b2455 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -3252,12 +3252,13 @@ DescriptorScriptPubKeyMan* CWallet::GetDescriptorScriptPubKeyMan(const WalletDes
ScriptPubKeyMan* CWallet::AddWalletDescriptor(WalletDescriptor& desc, const FlatSigningProvider& signing_provider, const std::string& label, bool internal)
{
+ AssertLockHeld(cs_wallet);
+
if (!IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)) {
WalletLogPrintf("Cannot add WalletDescriptor to a non-descriptor wallet\n");
return nullptr;
}
- LOCK(cs_wallet);
auto spk_man = GetDescriptorScriptPubKeyMan(desc);
if (spk_man) {
WalletLogPrintf("Update existing descriptor: %s\n", desc.descriptor->ToString());