Increase visibility of anchor related methods
authorKen Sedgwick <ken@bonsai.com>
Tue, 16 Nov 2021 02:50:57 +0000 (18:50 -0800)
committerKen Sedgwick <ken@bonsai.com>
Tue, 23 Nov 2021 16:01:34 +0000 (08:01 -0800)
lightning/src/ln/chan_utils.rs

index 80dd872a9de9cec9e6e3277cf0ccab8c4b2d9705..0db036d33092b55121c6a2c48ef66f79ce8465da 100644 (file)
@@ -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.