Skip to content

Commit

Permalink
Merge pull request #1585 from get10101/fix/do-not-swallow-error-on-br…
Browse files Browse the repository at this point in the history
…oadcasting-tx

fix: Do not swallow error when failing to broadcast transaction
  • Loading branch information
holzeis authored Nov 17, 2023
2 parents 3d96a61 + bf52a7b commit 39e77e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/ln-dlc-node/src/ldk_node_wallet.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::fee_rate_estimator::EstimateFeeRate;
use crate::node::Storage;
use anyhow::anyhow;
use anyhow::bail;
use anyhow::Context;
use anyhow::Error;
Expand Down Expand Up @@ -283,7 +284,7 @@ where

self.blockchain
.broadcast(tx)
.with_context(|| format!("Failed to broadcast transaction {txid}"))?;
.map_err(|e| anyhow!("Failed to broadcast transaction {txid}. {e:#}"))?;

Ok(txid)
}
Expand Down
4 changes: 4 additions & 0 deletions crates/tests-e2e/tests/force_close_position.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ use tests_e2e::wait_until;
#[tokio::test]
#[ignore = "need to be run with 'just e2e' command"]
async fn can_force_close_position() {
// TODO(holzeis): Adapt the test to be able to force close the DLC channel as well. At the
// moment this test is only able to force close the ln channel, as the maturity time will never
// be reached to get the oracles attestation to complete the dlc channel closure.

let test = setup::TestSetup::new_with_open_position().await;
let coordinator = &test.coordinator;
let bitcoin = &test.bitcoind;
Expand Down

0 comments on commit 39e77e4

Please sign in to comment.