Skip to content

Commit

Permalink
Merge pull request lightningdevkit#3407 from optout21/splice-init
Browse files Browse the repository at this point in the history
[Splicing] Partial, handle splice_init & splice_ack messages
  • Loading branch information
jkczyz authored Mar 7, 2025
2 parents e6267d3 + dc3ab7b commit 4c43a5b
Show file tree
Hide file tree
Showing 8 changed files with 700 additions and 20 deletions.
21 changes: 21 additions & 0 deletions lightning/src/ln/chan_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,27 @@ pub const HTLC_TIMEOUT_INPUT_ANCHOR_WITNESS_WEIGHT: u64 = 288;
/// outputs.
pub const HTLC_SUCCESS_INPUT_ANCHOR_WITNESS_WEIGHT: u64 = 327;

/// The size of the 2-of-2 multisig script
const MULTISIG_SCRIPT_SIZE: u64 =
1 + // OP_2
1 + // data len
33 + // pubkey1
1 + // data len
33 + // pubkey2
1 + // OP_2
1; // OP_CHECKMULTISIG
/// The weight of a funding transaction input (2-of-2 P2WSH)
/// See https://github.com/lightning/bolts/blob/master/03-transactions.md#expected-weight-of-the-commitment-transaction
pub const FUNDING_TRANSACTION_WITNESS_WEIGHT: u64 =
1 + // number_of_witness_elements
1 + // nil_len
1 + // sig len
73 + // sig1
1 + // sig len
73 + // sig2
1 + // witness_script_length
MULTISIG_SCRIPT_SIZE;

/// Gets the weight for an HTLC-Success transaction.
#[inline]
pub fn htlc_success_tx_weight(channel_type_features: &ChannelTypeFeatures) -> u64 {
Expand Down
Loading

0 comments on commit 4c43a5b

Please sign in to comment.