X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fchain%2Fchannelmonitor.rs;h=855263fe53b9bd09ce0f6bbbd64beabc34db64d5;hb=018a78328eea99a08a80190feceda2cf9142d5e5;hp=8a6f02452ec1abb6c61812ac4bc1974e54a07df2;hpb=d8cca9806c27014462bfb5ccb9e6488a14445425;p=rust-lightning diff --git a/lightning/src/chain/channelmonitor.rs b/lightning/src/chain/channelmonitor.rs index 8a6f0245..855263fe 100644 --- a/lightning/src/chain/channelmonitor.rs +++ b/lightning/src/chain/channelmonitor.rs @@ -1214,6 +1214,14 @@ impl ChannelMonitor { self.inner.lock().unwrap().get_cur_holder_commitment_number() } + /// 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 + } + /// Used by ChannelManager deserialization to broadcast the latest holder state if its copy of /// the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of /// fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows