Skip to content

Commit

Permalink
Don't log RPC connections to bitcoind (#3952)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphjaph authored Sep 17, 2024
1 parent 5ecc1d4 commit a861cdd
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,13 @@ impl Settings {

let bitcoin_credentials = self.bitcoin_credentials()?;

log::info!(
log::trace!(
"Connecting to Bitcoin Core at {}",
self.bitcoin_rpc_url(None)
);

if let Auth::CookieFile(cookie_file) = &bitcoin_credentials {
log::info!(
log::trace!(
"Using credentials from cookie file at `{}`",
cookie_file.display()
);
Expand All @@ -428,8 +428,16 @@ impl Settings {
);
}

let client = Client::new(&rpc_url, bitcoin_credentials)
.with_context(|| format!("failed to connect to Bitcoin Core RPC at `{rpc_url}`"))?;
let client = Client::new(&rpc_url, bitcoin_credentials.clone()).with_context(|| {
format!(
"failed to connect to Bitcoin Core RPC at `{rpc_url}` with {}",
match bitcoin_credentials {
Auth::None => "no credentials".into(),
Auth::UserPass(_, _) => "username and password".into(),
Auth::CookieFile(cookie_file) => format!("cookie file at {}", cookie_file.display()),
}
)
})?;

let mut checks = 0;
let rpc_chain = loop {
Expand Down

0 comments on commit a861cdd

Please sign in to comment.