Merge pull request #1635 from TheBlueMatt/2022-07-accessor-pub

Expose `ChannelMonitor::get_counterparty_node_id`
This commit is contained in:
Matt Corallo 2022-07-27 18:46:52 +00:00 committed by GitHub
commit 018a78328e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1214,7 +1214,11 @@ impl<Signer: Sign> ChannelMonitor<Signer> {
self.inner.lock().unwrap().get_cur_holder_commitment_number() self.inner.lock().unwrap().get_cur_holder_commitment_number()
} }
pub(crate) fn get_counterparty_node_id(&self) -> Option<PublicKey> { /// 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<PublicKey> {
self.inner.lock().unwrap().counterparty_node_id self.inner.lock().unwrap().counterparty_node_id
} }