X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fbitcoind_client.rs;h=7dc67c5fdc51451689798646a5e1b270871c444d;hb=db795e9f0c4ae10704ad14fce2986825b9f2aa59;hp=58510ae736bd894cbfece045db24ef4ddd9ded31;hpb=678119951c5b3460d24da64d0f2d755ef4f198e6;p=ldk-sample diff --git a/src/bitcoind_client.rs b/src/bitcoind_client.rs index 58510ae..7dc67c5 100644 --- a/src/bitcoind_client.rs +++ b/src/bitcoind_client.rs @@ -67,7 +67,14 @@ impl BitcoindClient { let http_endpoint = HttpEndpoint::for_host(host.clone()).with_port(port); let rpc_credentials = base64::encode(format!("{}:{}", rpc_user.clone(), rpc_password.clone())); - let bitcoind_rpc_client = RpcClient::new(&rpc_credentials, http_endpoint)?; + let mut bitcoind_rpc_client = RpcClient::new(&rpc_credentials, http_endpoint)?; + let _dummy = bitcoind_rpc_client + .call_method::("getblockchaininfo", &vec![]) + .await + .map_err(|_| { + std::io::Error::new(std::io::ErrorKind::PermissionDenied, + "Failed to make initial call to bitcoind - please check your RPC user/password and access settings") + })?; let mut fees: HashMap = HashMap::new(); fees.insert(Target::Background, AtomicU32::new(253)); fees.insert(Target::Normal, AtomicU32::new(2000));