From 0e91b1bac7cf9a6f771198f0765b68b3aaaf7eda Mon Sep 17 00:00:00 2001 From: Chris Guida Date: Tue, 28 Jan 2025 11:09:33 -0600 Subject: [PATCH] wip add scanblocks status --- Cargo.lock | 4 ++-- src/main.rs | 13 ++++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 20b92e6..9689a84 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -198,7 +198,7 @@ dependencies = [ [[package]] name = "bitcoincore-rpc" version = "0.17.0" -source = "git+https://github.com/chrisguida/rust-bitcoincore-rpc?branch=feat/scanblocks#23927f3e8b3bd413e0bf8b7c42b9531345bdd1a3" +source = "git+https://github.com/chrisguida/rust-bitcoincore-rpc?branch=feat/scanblocks#20fcea324b7a4665866148343ecc1796deb086ef" dependencies = [ "bitcoin-private", "bitcoincore-rpc-json", @@ -211,7 +211,7 @@ dependencies = [ [[package]] name = "bitcoincore-rpc-json" version = "0.17.0" -source = "git+https://github.com/chrisguida/rust-bitcoincore-rpc?branch=feat/scanblocks#23927f3e8b3bd413e0bf8b7c42b9531345bdd1a3" +source = "git+https://github.com/chrisguida/rust-bitcoincore-rpc?branch=feat/scanblocks#20fcea324b7a4665866148343ecc1796deb086ef" dependencies = [ "bitcoin", "bitcoin-private", diff --git a/src/main.rs b/src/main.rs index d6428ec..2903706 100644 --- a/src/main.rs +++ b/src/main.rs @@ -178,11 +178,18 @@ async fn main() -> Result<(), anyhow::Error> { brpc_auth.clone(), )?; - let _ = match rpc_client.get_connection_count() { + let _ = match rpc_client.scan_blocks_status() { Ok(cc) => cc, Err(e) => { - return Err(anyhow!("Cannot connect to bitcoind, ensure your `smaug_bprc_cookie_dir` or `smaug_brpc_user` and `smaug_brpc_pass` are correct - and that your node is active and accepting rpc connections")) + eprintln!("{}", e); + return Err(anyhow!(format!( + "Cannot connect to bitcoind. Ensure your `smaug_bprc_cookie_dir`,\n\ + `smaug_brpc_user` and `smaug_brpc_pass` are correct,\n\ + and that your node is active and accepting RPC connections.\n + Also make sure your version of bitcoind is at least v25, + and that it has blockfilterindex=1 enabled in the config file, + and that the block filter index has finished syncing." + ))); }, }; }