Skip to content

Commit

Permalink
Merge #586: bitcoind: create watchonly wallet with `load_on_startup =…
Browse files Browse the repository at this point in the history
… true`

8ae597f bitcoind: create watchonly wallet with load_on_startup = true (Antoine Poinsot)

Pull request description:

  Upon startup bitcoind will update loaded wallets before pruning historical chain data.

  This is a trivial fix for people using an aggressively pruned `bitcoind` to not be forced to `-reindex` if they haven't started their Liana wallet for longer than their prune target allows for.

  See #570 (comment) for a discussion about this.

ACKs for top commit:
  darosior:
    self-ACK 8ae597f

Tree-SHA512: 022ab1224d182372963a6ceb9baaf13aecc568b9d0d546d490ac1fb15450a8c70611b4b25a3a8a2f6cf613e28e8b54c8f5e4c55a4da723927ffc4c6e179f2a63
  • Loading branch information
darosior committed Jul 31, 2023
2 parents adf9bf8 + 8ae597f commit 3ccbb68
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/bitcoin/d/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
&params!(
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())?;
Expand Down

0 comments on commit 3ccbb68

Please sign in to comment.