let rpc_credentials =
base64::encode(format!("{}:{}", rpc_user.clone(), rpc_password.clone()));
let mut bitcoind_rpc_client = RpcClient::new(&rpc_credentials, http_endpoint)?;
- let _dummy = bitcoind_rpc_client.call_method::<BlockchainInfo>("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 _dummy = bitcoind_rpc_client
+ .call_method::<BlockchainInfo>("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<Target, AtomicU32> = HashMap::new();
fees.insert(Target::Background, AtomicU32::new(253));
fees.insert(Target::Normal, AtomicU32::new(2000));
// Check that the bitcoind we've connected to is running the network we expect
let bitcoind_chain = bitcoind_client.get_blockchain_info().await.chain;
- if bitcoind_chain != match args.network {
- bitcoin::Network::Bitcoin => "main",
- bitcoin::Network::Testnet => "test",
- bitcoin::Network::Regtest => "regtest",
- bitcoin::Network::Signet => "signet",
- } {
- println!("Chain argument ({}) didn't match bitcoind chain ({})", args.network, bitcoind_chain);
+ if bitcoind_chain
+ != match args.network {
+ bitcoin::Network::Bitcoin => "main",
+ bitcoin::Network::Testnet => "test",
+ bitcoin::Network::Regtest => "regtest",
+ bitcoin::Network::Signet => "signet",
+ } {
+ println!(
+ "Chain argument ({}) didn't match bitcoind chain ({})",
+ args.network, bitcoind_chain
+ );
return;
}