lightningdevkit / rust-lightning

A highly modular Bitcoin Lightning library written in Rust. It's rust-lightning, not Rusty's Lightning!
Other
1.16k stars 366 forks source link

Post-997 cleanups #1086

Open TheBlueMatt opened 3 years ago

TheBlueMatt commented 3 years ago

We want to land #997 asap, so leave a few cleanups until post-merge, eg

TheBlueMatt commented 3 years ago

Also, at this point, we really need to just have a helper function for channel close that does something like:

if let Ok(channel_update) = self.get_channel_update_for_broadcast(&channel) {
     channel_state.pending_msg_events.push(events::MessageSendEvent::BroadcastChannelUpdate {
          msg: channel_update
      });
}
if let Ok(mut pending_events_lock) = self.pending_events.lock() {
     pending_events_lock.push(events::Event::ChannelClosed {
          channel_id: *channel_id,
          reason: ClosureReason::HolderForceClosed
     });
}