Skip to content

Commit

Permalink
chore: return counterparty pk when rejecting subchannel offer
Browse files Browse the repository at this point in the history
Useful because we will need to send the reject message afterwards and for that we need the key.
  • Loading branch information
bonomat committed Dec 4, 2023
1 parent 8a17da1 commit 0b4db83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions dlc-manager/src/sub_channel_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,7 @@ where
}

/// Reject an offer to establish a sub channel.
pub fn reject_sub_channel_offer(&self, channel_id: ChannelId) -> Result<Reject, Error> {
pub fn reject_sub_channel_offer(&self, channel_id: ChannelId) -> Result<(PublicKey, Reject), Error> {
let (mut sub_channel, _) = get_sub_channel_in_state!(
self.dlc_channel_manager,
channel_id,
Expand All @@ -1464,7 +1464,7 @@ where
.get_store()
.upsert_sub_channel(&sub_channel)?;

Ok(Reject { channel_id })
Ok((sub_channel.counter_party, Reject { channel_id }))
}

/// Reject an offer to collaboratively close a sub channel off chain.
Expand Down
2 changes: 1 addition & 1 deletion dlc-manager/tests/ln_dlc_channel_execution_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2855,7 +2855,7 @@ fn reject_offer(test_params: &LnDlcTestParams) {
Offered
);

let reject = test_params
let (_, reject) = test_params
.bob_node
.sub_channel_manager
.reject_sub_channel_offer(test_params.channel_id)
Expand Down

0 comments on commit 0b4db83

Please sign in to comment.