X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fchain%2Fpackage.rs;h=5537a56f2f3898bcee470ae1fae87cbf44c5767c;hb=da34ada8d4df31f96e69133e7bdad891a2710001;hp=dbf46298888ce20a8225c6a11bd88e1394c2552e;hpb=eea56e967ff5f5fc903ce22c1b61415ccd48993e;p=rust-lightning diff --git a/lightning/src/chain/package.rs b/lightning/src/chain/package.rs index dbf46298..5537a56f 100644 --- a/lightning/src/chain/package.rs +++ b/lightning/src/chain/package.rs @@ -25,7 +25,7 @@ use crate::ln::chan_utils::{TxCreationKeys, HTLCOutputInCommitment}; use crate::ln::chan_utils; use crate::ln::msgs::DecodeError; use crate::chain::chaininterface::{FeeEstimator, ConfirmationTarget, MIN_RELAY_FEE_SAT_PER_1000_WEIGHT}; -use crate::chain::keysinterface::Sign; +use crate::chain::keysinterface::WriteableEcdsaChannelSigner; #[cfg(anchors)] use crate::chain::onchaintx::ExternalHTLCClaim; use crate::chain::onchaintx::OnchainTxHandler; @@ -203,11 +203,11 @@ impl CounterpartyOfferedHTLCOutput { impl_writeable_tlv_based!(CounterpartyOfferedHTLCOutput, { (0, per_commitment_point, required), - (1, opt_anchors, option), (2, counterparty_delayed_payment_base_key, required), (4, counterparty_htlc_base_key, required), (6, preimage, required), (8, htlc, required), + (10, opt_anchors, option), }); /// A struct to describe a HTLC output on a counterparty commitment transaction. @@ -241,10 +241,10 @@ impl CounterpartyReceivedHTLCOutput { impl_writeable_tlv_based!(CounterpartyReceivedHTLCOutput, { (0, per_commitment_point, required), - (1, opt_anchors, option), (2, counterparty_delayed_payment_base_key, required), (4, counterparty_htlc_base_key, required), (6, htlc, required), + (8, opt_anchors, option), }); /// A struct to describe a HTLC output on holder commitment transaction. @@ -318,7 +318,7 @@ impl HolderFundingOutput { impl_writeable_tlv_based!(HolderFundingOutput, { (0, funding_redeemscript, required), - (1, opt_anchors, option), + (2, opt_anchors, option), (3, funding_amount, option), }); @@ -392,7 +392,7 @@ impl PackageSolvingData { _ => { mem::discriminant(self) == mem::discriminant(&input) } } } - fn finalize_input(&self, bumped_tx: &mut Transaction, i: usize, onchain_handler: &mut OnchainTxHandler) -> bool { + fn finalize_input(&self, bumped_tx: &mut Transaction, i: usize, onchain_handler: &mut OnchainTxHandler) -> bool { match self { PackageSolvingData::RevokedOutput(ref outp) => { let chan_keys = TxCreationKeys::derive_new(&onchain_handler.secp_ctx, &outp.per_commitment_point, &outp.counterparty_delayed_payment_base_key, &outp.counterparty_htlc_base_key, &onchain_handler.signer.pubkeys().revocation_basepoint, &onchain_handler.signer.pubkeys().htlc_basepoint); @@ -448,7 +448,7 @@ impl PackageSolvingData { } true } - fn get_finalized_tx(&self, outpoint: &BitcoinOutPoint, onchain_handler: &mut OnchainTxHandler) -> Option { + fn get_finalized_tx(&self, outpoint: &BitcoinOutPoint, onchain_handler: &mut OnchainTxHandler) -> Option { match self { PackageSolvingData::HolderHTLCOutput(ref outp) => { debug_assert!(!outp.opt_anchors()); @@ -657,7 +657,7 @@ impl PackageTemplate { inputs_weight + witnesses_weight + transaction_weight + output_weight } #[cfg(anchors)] - pub(crate) fn construct_malleable_package_with_external_funding( + pub(crate) fn construct_malleable_package_with_external_funding( &self, onchain_handler: &mut OnchainTxHandler, ) -> Option> { debug_assert!(self.requires_external_funding()); @@ -675,7 +675,7 @@ impl PackageTemplate { } htlcs } - pub(crate) fn finalize_malleable_package( + pub(crate) fn finalize_malleable_package( &self, onchain_handler: &mut OnchainTxHandler, value: u64, destination_script: Script, logger: &L ) -> Option where L::Target: Logger { debug_assert!(self.is_malleable()); @@ -703,7 +703,7 @@ impl PackageTemplate { log_debug!(logger, "Finalized transaction {} ready to broadcast", bumped_tx.txid()); Some(bumped_tx) } - pub(crate) fn finalize_untractable_package( + pub(crate) fn finalize_untractable_package( &self, onchain_handler: &mut OnchainTxHandler, logger: &L, ) -> Option where L::Target: Logger { debug_assert!(!self.is_malleable());