diff --git a/CHANGELOG.md b/CHANGELOG.md index d69fd82c03..ef62f43ff1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,14 @@ The format is loosely based on [Keep a Changelog](https://keepachangelog.com/en/ ## [Unreleased] +### Fixed + - Wallet: + - Fixed an issue where `standalone-add-watch-only-address`, `standalone-add-private-key-from-hex` and + `standalone-add-multisig` (and the corresponding RPC methods) would reset the wallet to genesis but never + perform the announced rescan; the rescan is now done before the command returns. Previously, in `wallet-cli` + non-interactive mode the process would exit before the background rescan could run, leaving the wallet + stuck at genesis so that every subsequent wallet open had to rescan the whole blockchain. + ## [1.4.0] - 2026-07-09 ### Added diff --git a/wallet/wallet-rpc-lib/src/rpc/mod.rs b/wallet/wallet-rpc-lib/src/rpc/mod.rs index 3f28c91f20..6b333abb75 100644 --- a/wallet/wallet-rpc-lib/src/rpc/mod.rs +++ b/wallet/wallet-rpc-lib/src/rpc/mod.rs @@ -366,8 +366,9 @@ where .await? .add_standalone_address(pkh, label); - if !no_rescan { + if res.is_ok() && !no_rescan { w.reset_wallet_to_genesis()?; + w.sync_once().await?; } res @@ -396,8 +397,9 @@ where .await? .add_standalone_private_key(private_key, label); - if !no_rescan { + if res.is_ok() && !no_rescan { w.reset_wallet_to_genesis()?; + w.sync_once().await?; } res @@ -455,8 +457,9 @@ where .await? .add_standalone_multisig(challenge, label); - if !no_rescan { + if res.is_ok() && !no_rescan { w.reset_wallet_to_genesis()?; + w.sync_once().await?; } res