Add detailed logging for RPC connection and fix wallet URL construction

This commit is contained in:
Nicolas Cantu 2025-08-22 14:15:12 +02:00
parent f154330dba
commit 040c643175
2 changed files with 7 additions and 2 deletions

2
Cargo.lock generated
View File

@ -1740,7 +1740,7 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "sdk_common"
version = "0.1.0"
source = "git+https://git.4nkweb.com/4nk/sdk_common.git?branch=dev#a4c2fd209016f46dfb94c513c5db2c18d27b1f8a"
source = "git+https://git.4nkweb.com/4nk/sdk_common.git?branch=docker-support#a4c2fd209016f46dfb94c513c5db2c18d27b1f8a"
dependencies = [
"aes-gcm",
"anyhow",

View File

@ -92,10 +92,15 @@ fn read_cookie(path: &Path) -> Result<(String, String)> {
fn rpc_connect(rpcwallet: Option<String>, network: Network, mut rpc_url: String, cookie_path: Option<PathBuf>) -> Result<Client> {
match rpcwallet {
Some(rpcwallet) => rpc_url.push_str(&rpcwallet),
Some(ref rpcwallet) => {
rpc_url.push_str("/wallet/");
rpc_url.push_str(rpcwallet);
},
None => (),
}
log::info!("Attempting to connect to Bitcoin Core at: {}", rpc_url);
// Allow `wait_for_new_block` to take a bit longer before timing out.
// See https://github.com/romanz/electrs/issues/495 for more details.
let builder = jsonrpc::simple_http::SimpleHttpTransport::builder()