Skip to content

Commit c5c22ad

Browse files
committed
fix(cliv2): scanning fails when birthday block does not exist
When the wallet is just created, there is no blocks on the LocalChain, making the request of the birthday checkpoint impossible to serve. This change avoids the issue by directly using the height and hash set on the wallet.birthday field.
1 parent 4f96a0e commit c5c22ad

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

cli/v2/src/main.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -335,13 +335,7 @@ async fn main() -> anyhow::Result<()> {
335335
let hash = wallet.chain().tip().hash();
336336
HeaderCheckpoint::new(height, hash)
337337
} else {
338-
let checkpoint = wallet
339-
.chain()
340-
.get(wallet.birthday.height)
341-
.expect("should be something");
342-
let height = checkpoint.height();
343-
let hash = checkpoint.hash();
344-
HeaderCheckpoint::new(height, hash)
338+
HeaderCheckpoint::new(wallet.birthday.height, wallet.birthday.hash)
345339
};
346340

347341
tracing::info!(

0 commit comments

Comments
 (0)