aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/external_signer_scriptpubkeyman.cpp
diff options
context:
space:
mode:
authorSjors Provoost <sjors@sprovoost.nl>2023-11-21 23:07:00 -0300
committerfurszy <matiasfurszyfer@protonmail.com>2023-11-21 23:07:00 -0300
commitf05302427386fe63f4929a7198652cb1e4ab3bcc (patch)
tree9f864e5e94fd7bd7682a67345c06f56fa8547725 /src/wallet/external_signer_scriptpubkeyman.cpp
parent1f65241b733cd1e962c88909ae66816bc6451fd1 (diff)
downloadbitcoin-f05302427386fe63f4929a7198652cb1e4ab3bcc.tar.xz
wallet: batch external signer descriptor import
Co-authored-by: furszy <matiasfurszyfer@protonmail.com>
Diffstat (limited to 'src/wallet/external_signer_scriptpubkeyman.cpp')
-rw-r--r--src/wallet/external_signer_scriptpubkeyman.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/wallet/external_signer_scriptpubkeyman.cpp b/src/wallet/external_signer_scriptpubkeyman.cpp
index 6d026d02c1..a71f8f9fbc 100644
--- a/src/wallet/external_signer_scriptpubkeyman.cpp
+++ b/src/wallet/external_signer_scriptpubkeyman.cpp
@@ -16,7 +16,7 @@
#include <vector>
namespace wallet {
-bool ExternalSignerScriptPubKeyMan::SetupDescriptor(std::unique_ptr<Descriptor> desc)
+bool ExternalSignerScriptPubKeyMan::SetupDescriptor(WalletBatch& batch, std::unique_ptr<Descriptor> desc)
{
LOCK(cs_desc_man);
assert(m_storage.IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS));
@@ -29,13 +29,12 @@ bool ExternalSignerScriptPubKeyMan::SetupDescriptor(std::unique_ptr<Descriptor>
m_wallet_descriptor = w_desc;
// Store the descriptor
- WalletBatch batch(m_storage.GetDatabase());
if (!batch.WriteDescriptor(GetID(), m_wallet_descriptor)) {
throw std::runtime_error(std::string(__func__) + ": writing descriptor failed");
}
// TopUp
- TopUp();
+ TopUpWithDB(batch);
m_storage.UnsetBlankWalletFlag(batch);
return true;