Skip to content

Commit 4506665

Browse files
committed
fixup! cleanup
1 parent 7d4f3d5 commit 4506665

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

lightning/src/chain/channelmonitor.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,6 @@ impl Readable for ChannelMonitorUpdateStep {
605605
pub struct ChannelMonitor<ChanSigner: ChannelKeys> {
606606
latest_update_id: u64,
607607
commitment_transaction_number_obscure_factor: u64,
608-
is_outbound: bool,
609608

610609
destination_script: Script,
611610
broadcasted_holder_revokable_script: Option<(Script, PublicKey, PublicKey)>,
@@ -757,7 +756,6 @@ impl<ChanSigner: ChannelKeys + Writeable> ChannelMonitor<ChanSigner> {
757756

758757
// Set in initial Channel-object creation, so should always be set by now:
759758
U48(self.commitment_transaction_number_obscure_factor).write(writer)?;
760-
self.is_outbound.write(writer)?;
761759

762760
self.destination_script.write(writer)?;
763761
if let Some(ref broadcasted_holder_revokable_script) = self.broadcasted_holder_revokable_script {
@@ -983,7 +981,6 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
983981
ChannelMonitor {
984982
latest_update_id: 0,
985983
commitment_transaction_number_obscure_factor,
986-
is_outbound: channel_parameters.is_outbound_from_holder,
987984

988985
destination_script: destination_script.clone(),
989986
broadcasted_holder_revokable_script: None,
@@ -2218,7 +2215,6 @@ impl<ChanSigner: ChannelKeys + Readable> Readable for (BlockHash, ChannelMonitor
22182215

22192216
let latest_update_id: u64 = Readable::read(reader)?;
22202217
let commitment_transaction_number_obscure_factor = <U48 as Readable>::read(reader)?.0;
2221-
let is_outbound = Readable::read(reader)?;
22222218

22232219
let destination_script = Readable::read(reader)?;
22242220
let broadcasted_holder_revokable_script = match <u8 as Readable>::read(reader)? {
@@ -2442,7 +2438,6 @@ impl<ChanSigner: ChannelKeys + Readable> Readable for (BlockHash, ChannelMonitor
24422438
Ok((last_block_hash.clone(), ChannelMonitor {
24432439
latest_update_id,
24442440
commitment_transaction_number_obscure_factor,
2445-
is_outbound,
24462441

24472442
destination_script,
24482443
broadcasted_holder_revokable_script,

lightning/src/ln/chan_utils.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ impl HolderCommitmentTransaction {
688688
}
689689
}
690690
pub(crate) fn txid<T: secp256k1::Signing + secp256k1::Verification>(&self, channel_parameters: &DirectedChannelTransactionParameters, secp_ctx: &Secp256k1<T>) -> Txid {
691-
self.info.txid(channel_parameters, secp_ctx)
691+
self.info.calculate_txid(channel_parameters, secp_ctx)
692692
}
693693
}
694694

@@ -763,12 +763,12 @@ impl_writeable!(CommitmentTransaction, 0, {
763763
});
764764

765765
impl CommitmentTransaction {
766-
/// Construct an object of the class while assigning transaction output indices to HTLCs.
767-
///
768-
/// Also keeps track of auxiliary HTLC data and returns it along with the mutated and sorted HTLCs.
769-
/// This allows the caller to match the HTLC output index with the auxiliary data.
770-
/// This auxiliary data is not stored in this object.
771-
pub fn new_with_auxiliary_htlc_data<T: Copy>(commitment_number: u64, to_broadcaster_value_sat: u64, to_countersignatory_value_sat: u64, keys: TxCreationKeys, feerate_per_kw: u32, htlcs_with_aux: Vec<(HTLCOutputInCommitment, T)>, channel_parameters: &DirectedChannelTransactionParameters, secp_ctx: &Secp256k1<secp256k1::All>) -> (CommitmentTransaction, Vec<(HTLCOutputInCommitment, T)>) {
766+
// Construct an object of the class while assigning transaction output indices to HTLCs.
767+
//
768+
// Also keeps track of auxiliary HTLC data and returns it along with the mutated and sorted HTLCs.
769+
// This allows the caller to match the HTLC output index with the auxiliary data.
770+
// This auxiliary data is not stored in this object.
771+
pub(crate) fn new_with_auxiliary_htlc_data<T: Copy>(commitment_number: u64, to_broadcaster_value_sat: u64, to_countersignatory_value_sat: u64, keys: TxCreationKeys, feerate_per_kw: u32, htlcs_with_aux: Vec<(HTLCOutputInCommitment, T)>, channel_parameters: &DirectedChannelTransactionParameters, secp_ctx: &Secp256k1<secp256k1::All>) -> (CommitmentTransaction, Vec<(HTLCOutputInCommitment, T)>) {
772772
// Sort outputs and populate output indices while keeping track of the auxiliary data
773773
let mut txouts = Self::do_build_outputs(&keys, to_broadcaster_value_sat, to_countersignatory_value_sat, &htlcs_with_aux, channel_parameters, &secp_ctx).unwrap();
774774
let mut result_htlcs_with_aux = Vec::new();
@@ -792,7 +792,7 @@ impl CommitmentTransaction {
792792
(info, result_htlcs_with_aux)
793793
}
794794

795-
pub(crate) fn txid<T: secp256k1::Signing + secp256k1::Verification>(&self, channel_parameters: &DirectedChannelTransactionParameters, secp_ctx: &Secp256k1<T>) -> Txid {
795+
pub(crate) fn calculate_txid<T: secp256k1::Signing + secp256k1::Verification>(&self, channel_parameters: &DirectedChannelTransactionParameters, secp_ctx: &Secp256k1<T>) -> Txid {
796796
let tx = self.build(channel_parameters, secp_ctx).unwrap().0;
797797
tx.txid()
798798
}

0 commit comments

Comments
 (0)