impl Deref for EmptyNodeIdLookUp
[rust-lightning] / lightning / src / ln / chan_utils.rs
index c002dfaea25f62297518d9f8b94dcc898004c7da..3c99cdb0943c1f1ddd44d444eee5c0f255f0fab8 100644 (file)
@@ -25,7 +25,7 @@ use bitcoin::hash_types::{Txid, PubkeyHash, WPubkeyHash};
 use crate::chain::chaininterface::fee_for_weight;
 use crate::chain::package::WEIGHT_REVOKED_OUTPUT;
 use crate::sign::EntropySource;
-use crate::ln::{PaymentHash, PaymentPreimage};
+use crate::ln::types::{PaymentHash, PaymentPreimage};
 use crate::ln::msgs::DecodeError;
 use crate::util::ser::{Readable, RequiredWrapper, Writeable, Writer};
 use crate::util::transaction_utils;
@@ -852,6 +852,11 @@ impl ChannelTransactionParameters {
                self.counterparty_parameters.is_some() && self.funding_outpoint.is_some()
        }
 
+       /// Whether the channel supports zero-fee HTLC transaction anchors.
+       pub(crate) fn supports_anchors(&self) -> bool {
+               self.channel_type_features.supports_anchors_zero_fee_htlc_tx()
+       }
+
        /// Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
        /// given that the holder is the broadcaster.
        ///
@@ -1821,7 +1826,7 @@ mod tests {
        use bitcoin::{Network, Txid, ScriptBuf};
        use bitcoin::hashes::Hash;
        use bitcoin::hashes::hex::FromHex;
-       use crate::ln::PaymentHash;
+       use crate::ln::types::PaymentHash;
        use bitcoin::address::Payload;
        use bitcoin::PublicKey as BitcoinPublicKey;
        use crate::ln::features::ChannelTypeFeatures;