From: Matt Corallo Date: Wed, 27 Jul 2022 03:53:47 +0000 (+0000) Subject: Expose `ChannelMonitor::get_counterparty_node_id` X-Git-Tag: v0.0.111~49^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=75b111291faf931f4a203e1d75d2c8ed8b6eb7dd;p=rust-lightning Expose `ChannelMonitor::get_counterparty_node_id` This fixes an oversight in ac842ed9dd7a36a4a26eb6b856d80ab04eecf750 namely that it left users unable to implement their own `ChainMonitor` from outside of the `rust-lightning` crate. --- diff --git a/lightning/src/chain/channelmonitor.rs b/lightning/src/chain/channelmonitor.rs index 38dcd6cf0..855263fe5 100644 --- a/lightning/src/chain/channelmonitor.rs +++ b/lightning/src/chain/channelmonitor.rs @@ -1214,7 +1214,11 @@ impl ChannelMonitor { self.inner.lock().unwrap().get_cur_holder_commitment_number() } - pub(crate) fn get_counterparty_node_id(&self) -> Option { + /// Gets the `node_id` of the counterparty for this channel. + /// + /// Will be `None` for channels constructed on LDK versions prior to 0.0.110 and always `Some` + /// otherwise. + pub fn get_counterparty_node_id(&self) -> Option { self.inner.lock().unwrap().counterparty_node_id }