Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
tankyleo committed Feb 22, 2025
1 parent 7fc689d commit cc57237
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions lightning/src/sign/tx_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use crate::ln::chan_utils::{
self, ChannelTransactionParameters, CommitmentTransaction,
DirectedChannelTransactionParameters, HTLCOutputInCommitment, TxCreationKeys,
};
use crate::ln::channelmanager::HTLCSource;
use crate::ln::channel::CommitmentStats;
use crate::ln::channelmanager::HTLCSource;
use crate::prelude::*;

/// A trait for types that can build commitment transactions, both for the holder, and the counterparty.
Expand All @@ -20,10 +20,11 @@ pub(crate) trait TxBuilder {
/// Do not sort `htlcs`; this will be done by the caller as needed.
/// This method will be called only after all the channel parameters have been provided via `provide_channel_parameters`.
fn build_commitment_transaction<'a>(
&self, local: bool,
commitment_number: u64, per_commitment_point: &PublicKey, channel_parameters: &ChannelTransactionParameters, secp_ctx: &Secp256k1<secp256k1::All>,
channel_value_satoshis: u64, value_to_self_msat: i64, htlcs_in_tx: Vec<(HTLCOutputInCommitment, Option<&'a HTLCSource>)>,
feerate_per_kw: u32, broadcaster_dust_limit_satoshis: u64,
&self, local: bool, commitment_number: u64, per_commitment_point: &PublicKey,
channel_parameters: &ChannelTransactionParameters, secp_ctx: &Secp256k1<secp256k1::All>,
channel_value_satoshis: u64, value_to_self_msat: i64,
htlcs_in_tx: Vec<(HTLCOutputInCommitment, Option<&'a HTLCSource>)>, feerate_per_kw: u32,
broadcaster_dust_limit_satoshis: u64,
) -> CommitmentStats<'a>;
}

Expand All @@ -33,10 +34,11 @@ pub struct SpecTxBuilder {}

impl TxBuilder for SpecTxBuilder {
fn build_commitment_transaction<'a>(
&self, local: bool,
commitment_number: u64, per_commitment_point: &PublicKey, channel_parameters: &ChannelTransactionParameters, secp_ctx: &Secp256k1<secp256k1::All>,
channel_value_satoshis: u64, mut value_to_self_msat: i64, htlcs_in_tx: Vec<(HTLCOutputInCommitment, Option<&'a HTLCSource>)>,
feerate_per_kw: u32, broadcaster_dust_limit_satoshis: u64,
&self, local: bool, commitment_number: u64, per_commitment_point: &PublicKey,
channel_parameters: &ChannelTransactionParameters, secp_ctx: &Secp256k1<secp256k1::All>,
channel_value_satoshis: u64, mut value_to_self_msat: i64,
htlcs_in_tx: Vec<(HTLCOutputInCommitment, Option<&'a HTLCSource>)>, feerate_per_kw: u32,
broadcaster_dust_limit_satoshis: u64,
) -> CommitmentStats<'a> {
let mut local_htlc_total_msat = 0;
let mut remote_htlc_total_msat = 0;
Expand Down Expand Up @@ -138,7 +140,12 @@ impl TxBuilder for SpecTxBuilder {
value_to_b = 0;
}

let keys = TxCreationKeys::from_channel_static_keys(per_commitment_point, params.broadcaster_pubkeys(), params.countersignatory_pubkeys(), &secp_ctx);
let keys = TxCreationKeys::from_channel_static_keys(
per_commitment_point,
params.broadcaster_pubkeys(),
params.countersignatory_pubkeys(),
&secp_ctx,
);

let tx = CommitmentTransaction::new_with_auxiliary_htlc_data(
commitment_number,
Expand Down

0 comments on commit cc57237

Please sign in to comment.