X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=lightning%2Fsrc%2Fevents%2Fbump_transaction.rs;h=6d8a5bb6c65f55341a4a4160408e1949570ed998;hb=82b646c548b489188b2be54cc36890302378da92;hp=7c97e2d4c140003e190f5398b67d25e291193c5b;hpb=15b1c9b83715ed98fa8c538195d13d44967031fb;p=rust-lightning diff --git a/lightning/src/events/bump_transaction.rs b/lightning/src/events/bump_transaction.rs index 7c97e2d4..6d8a5bb6 100644 --- a/lightning/src/events/bump_transaction.rs +++ b/lightning/src/events/bump_transaction.rs @@ -14,16 +14,17 @@ use core::ops::Deref; use crate::chain::chaininterface::BroadcasterInterface; use crate::chain::ClaimId; -use crate::sign::{ChannelSigner, EcdsaChannelSigner, SignerProvider}; +use crate::events::Event; use crate::io_extras::sink; -use crate::ln::PaymentPreimage; use crate::ln::chan_utils; use crate::ln::chan_utils::{ ANCHOR_INPUT_WITNESS_WEIGHT, HTLC_SUCCESS_INPUT_ANCHOR_WITNESS_WEIGHT, HTLC_TIMEOUT_INPUT_ANCHOR_WITNESS_WEIGHT, ChannelTransactionParameters, HTLCOutputInCommitment }; -use crate::events::Event; -use crate::prelude::HashMap; +use crate::ln::features::ChannelTypeFeatures; +use crate::ln::PaymentPreimage; +use crate::prelude::*; +use crate::sign::{ChannelSigner, EcdsaChannelSigner, SignerProvider}; use crate::sync::Mutex; use crate::util::logger::Logger; @@ -104,7 +105,7 @@ impl HTLCDescriptor { /// Returns the unsigned transaction input spending the HTLC output in the commitment /// transaction. pub fn unsigned_tx_input(&self) -> TxIn { - chan_utils::build_htlc_input(&self.commitment_txid, &self.htlc, true /* opt_anchors */) + chan_utils::build_htlc_input(&self.commitment_txid, &self.htlc, &ChannelTypeFeatures::anchors_zero_htlc_fee_and_dependencies()) } /// Returns the delayed output created as a result of spending the HTLC output in the commitment @@ -122,8 +123,8 @@ impl HTLCDescriptor { secp, per_commitment_point, &counterparty_keys.revocation_basepoint ); chan_utils::build_htlc_output( - 0 /* feerate_per_kw */, channel_params.contest_delay(), &self.htlc, true /* opt_anchors */, - false /* use_non_zero_fee_anchors */, &broadcaster_delayed_key, &counterparty_revocation_key + 0 /* feerate_per_kw */, channel_params.contest_delay(), &self.htlc, + &ChannelTypeFeatures::anchors_zero_htlc_fee_and_dependencies(), &broadcaster_delayed_key, &counterparty_revocation_key ) } @@ -144,7 +145,7 @@ impl HTLCDescriptor { secp, per_commitment_point, &counterparty_keys.revocation_basepoint ); chan_utils::get_htlc_redeemscript_with_explicit_keys( - &self.htlc, true /* opt_anchors */, &broadcaster_htlc_key, &counterparty_htlc_key, + &self.htlc, &ChannelTypeFeatures::anchors_zero_htlc_fee_and_dependencies(), &broadcaster_htlc_key, &counterparty_htlc_key, &counterparty_revocation_key, ) } @@ -153,7 +154,7 @@ impl HTLCDescriptor { /// transaction. pub fn tx_input_witness(&self, signature: &Signature, witness_script: &Script) -> Witness { chan_utils::build_htlc_input_witness( - signature, &self.counterparty_sig, &self.preimage, witness_script, true /* opt_anchors */ + signature, &self.counterparty_sig, &self.preimage, witness_script, &ChannelTypeFeatures::anchors_zero_htlc_fee_and_dependencies() /* opt_anchors */ ) } }