Skip to content

Commit

Permalink
fix: Propose the settled amount when collab closing a channel
Browse files Browse the repository at this point in the history
  • Loading branch information
holzeis committed Feb 10, 2024
1 parent 4866c80 commit e77eb77
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions crates/ln-dlc-node/src/node/dlc_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,13 @@ impl<S: TenTenOneStorage + 'static, N: LnDlcStorage + Sync + Send + 'static> Nod
let counterparty = channel.counter_party;

match channel.state {
SignedChannelState::Settled { .. } | SignedChannelState::RenewFinalized { .. } => {
SignedChannelState::Settled { counter_payout, .. } => {
spawn_blocking({
let dlc_manager = self.dlc_manager.clone();
let event_handler = self.event_handler.clone();
move || {
let settle_offer = dlc_manager
.offer_collaborative_close(
&channel.channel_id,
channel.counter_params.collateral,
)
.offer_collaborative_close(&channel.channel_id, counter_payout)
.context(
"Could not propose to collaboratively close the dlc channel.",
)?;
Expand All @@ -171,8 +168,8 @@ impl<S: TenTenOneStorage + 'static, N: LnDlcStorage + Sync + Send + 'static> Nod
.await??;
}
_ => {
tracing::error!( state = %channel.state, "Can't collaboratively close a channel with an open position.");
bail!("Can't collaboratively close a channel with an open position");
tracing::error!( state = %channel.state, "Can't collaboratively close a channel which is not settled.");
bail!("Can't collaboratively close a channel which is not settled");
}
}

Expand Down

0 comments on commit e77eb77

Please sign in to comment.