From 8ae597fec11c2fdd7873c9bd011a75a5fbbd9301 Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Mon, 31 Jul 2023 12:40:59 +0200 Subject: [PATCH] bitcoind: create watchonly wallet with load_on_startup = true --- src/bitcoin/d/mod.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/bitcoin/d/mod.rs b/src/bitcoin/d/mod.rs index 9d3d670c..2af4690c 100644 --- a/src/bitcoin/d/mod.rs +++ b/src/bitcoin/d/mod.rs @@ -512,13 +512,19 @@ impl BitcoinD { } fn create_wallet(&self, wallet_path: String) -> Result<(), String> { + // NOTE: we set load_on_startup to make sure the wallet will get updated before the + // historical blocks are deleted in case the bitcoind is pruned. let res = self .make_fallible_node_request( "createwallet", ¶ms!( Json::String(wallet_path), - Json::Bool(true), // watchonly - Json::Bool(true), // blank + Json::Bool(true), // watchonly + Json::Bool(true), // blank + Json::Null, // passphrase + Json::Bool(false), // avoid_reuse + Json::Bool(true), // descriptors + Json::Bool(true) // load_on_startup ), ) .map_err(|e| e.to_string())?;