I've been practicing on signet and got stuck here: scan-rpc just ignores the wallet's birthday and scans from genesis.
In cli/v2/src/main.rs, scan-rpc constructs the Emitter with start_height = 0:
// cli/v2/src/main.rs
Commands::ScanRpc { rpc_args } => {
let rpc_client = rpc_args.new_client()?;
let mut emitter = Emitter::new(
&rpc_client,
wallet.chain().tip(),
0,
NO_EXPECTED_MEMPOOL_TXIDS,
);
scan-cbf in the same file already handles this correctly — it compares the birthday against the chain tip and uses whichever is higher:
// cli/v2/src/main.rs
let sync_point = if let (Some(height), Some(hash)) = (height, hash) {
HeaderCheckpoint::new(height, hash)
} else if wallet.birthday.height <= wallet.chain().tip().height() {
HeaderCheckpoint::new(wallet.chain().tip().height(), wallet.chain().tip().hash())
} else {
HeaderCheckpoint::new(wallet.birthday.height, wallet.birthday.hash)
};
scan-rpc has no equivalent logic.
Reproduction
On signet, create a wallet with a birthday near the chain tip, then run scan-rpc.
The output will show the scanner starting from a very low block height and incrementing block by block through the entire chain history rather than jumping to the birthday height.
I've been practicing on signet and got stuck here:
scan-rpcjust ignores the wallet'sbirthdayand scans from genesis.In
cli/v2/src/main.rs,scan-rpcconstructs theEmitterwithstart_height = 0:scan-cbfin the same file already handles this correctly — it compares the birthday against the chain tip and uses whichever is higher:scan-rpchas no equivalent logic.Reproduction
On signet, create a wallet with a birthday near the chain tip, then run
scan-rpc.The output will show the scanner starting from a very low block height and incrementing block by block through the entire chain history rather than jumping to the birthday height.