Skip to content

Commit

Permalink
Use real channel closure node id
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed Sep 29, 2023
1 parent c4f99c3 commit 9a8affc
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions mutiny-core/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ impl<S: MutinyStorage> EventHandler<S> {
channel_id,
reason,
user_channel_id,
counterparty_node_id: node_id,
..
} => {
// if we still have channel open params, then it was just a failed channel open
Expand All @@ -494,16 +495,6 @@ impl<S: MutinyStorage> EventHandler<S> {
reason
);

// this doesn't really work, leaving here because maybe sometimes it'll get the node id
// can be fixed with https://github.com/lightningdevkit/rust-lightning/issues/2343
let node_id = self.channel_manager.list_channels().iter().find_map(|c| {
if c.channel_id == channel_id {
Some(c.counterparty.node_id)
} else {
None
}
});

let closure = ChannelClosure::new(user_channel_id, channel_id.0, node_id, reason);
if let Err(e) = self
.persister
Expand Down

0 comments on commit 9a8affc

Please sign in to comment.