X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fevents%2Fbump_transaction.rs;h=8b52af69fe331527a43ae38e0a67cd94e4ea4139;hb=c39c398f0618835201fb741b1976952c3f9180fa;hp=0676fef14b5bd53d33b164147fdf9b873a0e4f0a;hpb=3e0d55bd2b96ea10ecc744d4cbd9bbfc1ad4ef50;p=rust-lightning diff --git a/lightning/src/events/bump_transaction.rs b/lightning/src/events/bump_transaction.rs index 0676fef1..8b52af69 100644 --- a/lightning/src/events/bump_transaction.rs +++ b/lightning/src/events/bump_transaction.rs @@ -18,6 +18,7 @@ use crate::chain::chaininterface::{BroadcasterInterface, fee_for_weight}; use crate::chain::ClaimId; use crate::io_extras::sink; use crate::ln::channel::ANCHOR_OUTPUT_VALUE_SATOSHI; +use crate::ln::ChannelId; use crate::ln::chan_utils; use crate::ln::chan_utils::{ ANCHOR_INPUT_WITNESS_WEIGHT, HTLC_SUCCESS_INPUT_ANCHOR_WITNESS_WEIGHT, @@ -37,14 +38,14 @@ use bitcoin::blockdata::locktime::absolute::LockTime; use bitcoin::consensus::Encodable; use bitcoin::psbt::PartiallySignedTransaction; use bitcoin::secp256k1; -use bitcoin::secp256k1::Secp256k1; +use bitcoin::secp256k1::{PublicKey, Secp256k1}; use bitcoin::secp256k1::ecdsa::Signature; -const EMPTY_SCRIPT_SIG_WEIGHT: u64 = 1 /* empty script_sig */ * WITNESS_SCALE_FACTOR as u64; +pub(crate) const EMPTY_SCRIPT_SIG_WEIGHT: u64 = 1 /* empty script_sig */ * WITNESS_SCALE_FACTOR as u64; const BASE_INPUT_SIZE: u64 = 32 /* txid */ + 4 /* vout */ + 4 /* sequence */; -const BASE_INPUT_WEIGHT: u64 = BASE_INPUT_SIZE * WITNESS_SCALE_FACTOR as u64; +pub(crate) const BASE_INPUT_WEIGHT: u64 = BASE_INPUT_SIZE * WITNESS_SCALE_FACTOR as u64; /// A descriptor used to sign for a commitment transaction's anchor output. #[derive(Clone, Debug, PartialEq, Eq)] @@ -147,6 +148,10 @@ pub enum BumpTransactionEvent { /// [`EcdsaChannelSigner::sign_holder_anchor_input`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_holder_anchor_input /// [`build_anchor_input_witness`]: crate::ln::chan_utils::build_anchor_input_witness ChannelClose { + /// The `channel_id` of the channel which has been closed. + channel_id: ChannelId, + /// Counterparty in the closed channel. + counterparty_node_id: PublicKey, /// The unique identifier for the claim of the anchor output in the commitment transaction. /// /// The identifier must map to the set of external UTXOs assigned to the claim, such that @@ -200,6 +205,10 @@ pub enum BumpTransactionEvent { /// [`EcdsaChannelSigner`]: crate::sign::ecdsa::EcdsaChannelSigner /// [`EcdsaChannelSigner::sign_holder_htlc_transaction`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_holder_htlc_transaction HTLCResolution { + /// The `channel_id` of the channel which has been closed. + channel_id: ChannelId, + /// Counterparty in the closed channel. + counterparty_node_id: PublicKey, /// The unique identifier for the claim of the HTLCs in the confirmed commitment /// transaction. /// @@ -797,7 +806,7 @@ where } } BumpTransactionEvent::HTLCResolution { - claim_id, target_feerate_sat_per_1000_weight, htlc_descriptors, tx_lock_time, + claim_id, target_feerate_sat_per_1000_weight, htlc_descriptors, tx_lock_time, .. } => { log_info!(self.logger, "Handling HTLC bump (claim_id = {}, htlcs_to_claim = {})", log_bytes!(claim_id.0), log_iter!(htlc_descriptors.iter().map(|d| d.outpoint())));