Skip to content

Commit 37d778c

Browse files
authored
Merge pull request #2107 from erubboli/fix/standalone-add-rescan-not-performed
Perform the rescan when adding a standalone address
2 parents b882986 + 84394c4 commit 37d778c

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ The format is loosely based on [Keep a Changelog](https://keepachangelog.com/en/
1111

1212
## [Unreleased]
1313

14+
### Fixed
15+
- Wallet:
16+
- Fixed an issue where `standalone-add-watch-only-address`, `standalone-add-private-key-from-hex` and
17+
`standalone-add-multisig` (and the corresponding RPC methods) would reset the wallet to genesis but never
18+
perform the announced rescan; the rescan is now done before the command returns. Previously, in `wallet-cli`
19+
non-interactive mode the process would exit before the background rescan could run, leaving the wallet
20+
stuck at genesis so that every subsequent wallet open had to rescan the whole blockchain.
21+
1422
## [1.4.0] - 2026-07-09
1523

1624
### Added

wallet/wallet-rpc-lib/src/rpc/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,9 @@ where
366366
.await?
367367
.add_standalone_address(pkh, label);
368368

369-
if !no_rescan {
369+
if res.is_ok() && !no_rescan {
370370
w.reset_wallet_to_genesis()?;
371+
w.sync_once().await?;
371372
}
372373

373374
res
@@ -396,8 +397,9 @@ where
396397
.await?
397398
.add_standalone_private_key(private_key, label);
398399

399-
if !no_rescan {
400+
if res.is_ok() && !no_rescan {
400401
w.reset_wallet_to_genesis()?;
402+
w.sync_once().await?;
401403
}
402404

403405
res
@@ -455,8 +457,9 @@ where
455457
.await?
456458
.add_standalone_multisig(challenge, label);
457459

458-
if !no_rescan {
460+
if res.is_ok() && !no_rescan {
459461
w.reset_wallet_to_genesis()?;
462+
w.sync_once().await?;
460463
}
461464

462465
res

0 commit comments

Comments
 (0)