Skip to content

Commit

Permalink
Merge pull request #417 from vincenzopalazzo/macros/esplora-api
Browse files Browse the repository at this point in the history
undefined
  • Loading branch information
tnull authored Dec 4, 2024
2 parents 05130b6 + dc46a9d commit 2095d87
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/chain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -991,8 +991,8 @@ impl ChainSource {
);
},
Err(e) => match e {
esplora_client::Error::Reqwest(err) => {
if err.status() == reqwest::StatusCode::from_u16(400).ok() {
esplora_client::Error::HttpResponse { status, message } => {
if status == 400 {
// Log 400 at lesser level, as this often just means bitcoind already knows the
// transaction.
// FIXME: We can further differentiate here based on the error
Expand All @@ -1001,13 +1001,13 @@ impl ChainSource {
log_trace!(
logger,
"Failed to broadcast due to HTTP connection error: {}",
err
message
);
} else {
log_error!(
logger,
"Failed to broadcast due to HTTP connection error: {}",
err
"Failed to broadcast due to HTTP connection error: {} - {}",
status, message
);
}
log_trace!(
Expand Down

0 comments on commit 2095d87

Please sign in to comment.