From: Ken Sedgwick Date: Tue, 16 Nov 2021 02:50:57 +0000 (-0800) Subject: Increase visibility of anchor related methods X-Git-Tag: v0.0.104~25^2~3 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=c077f36b4b231b05b9c6bfadd5ef0c017b17eaa0;p=rust-lightning Increase visibility of anchor related methods --- diff --git a/lightning/src/ln/chan_utils.rs b/lightning/src/ln/chan_utils.rs index 80dd872a..0db036d3 100644 --- a/lightning/src/ln/chan_utils.rs +++ b/lightning/src/ln/chan_utils.rs @@ -636,7 +636,7 @@ pub(crate) fn get_to_countersignatory_with_anchors_redeemscript(payment_point: & /// <> /// (empty vector required to satisfy compliance with MINIMALIF-standard rule) #[inline] -pub(crate) fn get_anchor_redeemscript(funding_pubkey: &PublicKey) -> Script { +pub fn get_anchor_redeemscript(funding_pubkey: &PublicKey) -> Script { Builder::new().push_slice(&funding_pubkey.serialize()[..]) .push_opcode(opcodes::all::OP_CHECKSIG) .push_opcode(opcodes::all::OP_IFDUP) @@ -774,6 +774,11 @@ impl<'a> DirectedChannelTransactionParameters<'a> { pub fn funding_outpoint(&self) -> OutPoint { self.inner.funding_outpoint.unwrap().into_bitcoin_outpoint() } + + /// Whether to use anchors for this channel + pub fn opt_anchors(&self) -> bool { + self.inner.opt_anchors.is_some() + } } /// Information needed to build and sign a holder's commitment transaction.