Skip to content

Commit

Permalink
core: fixing the esplora error match
Browse files Browse the repository at this point in the history
Recent version of esplora (from v0.10) changed the
error type, so this commit is reflecting the change.

Link: #412
Signed-off-by: Vincenzo Palazzo <[email protected]>
  • Loading branch information
vincenzopalazzo committed Dec 3, 2024
1 parent 05130b6 commit dc46a9d
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 dc46a9d

Please sign in to comment.