Skip to content

Commit 797ce20

Browse files
committed
fix Post-rebase; Remove unused calculate_our_funding_satoshis
1 parent 26709b8 commit 797ce20

File tree

2 files changed

+4
-31
lines changed

2 files changed

+4
-31
lines changed

lightning/src/ln/channel.rs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4679,33 +4679,6 @@ fn estimate_v2_funding_transaction_fee(
46794679
fee_for_weight(funding_feerate_sat_per_1000_weight, weight)
46804680
}
46814681

4682-
#[allow(dead_code)] // TODO(dual_funding): Remove once V2 channels is enabled.
4683-
pub(super) fn calculate_our_funding_satoshis(
4684-
is_initiator: bool, funding_inputs: &[(TxIn, TransactionU16LenLimited)],
4685-
total_witness_weight: Weight, funding_feerate_sat_per_1000_weight: u32,
4686-
holder_dust_limit_satoshis: u64,
4687-
) -> Result<u64, APIError> {
4688-
let estimated_fee = estimate_v2_funding_transaction_fee(is_initiator, funding_inputs.len(), total_witness_weight, funding_feerate_sat_per_1000_weight);
4689-
4690-
let mut total_input_satoshis = 0u64;
4691-
for (idx, input) in funding_inputs.iter().enumerate() {
4692-
if let Some(output) = input.1.as_transaction().output.get(input.0.previous_output.vout as usize) {
4693-
total_input_satoshis = total_input_satoshis.saturating_add(output.value.to_sat());
4694-
} else {
4695-
return Err(APIError::APIMisuseError {
4696-
err: format!("Transaction with txid {} does not have an output with vout of {} corresponding to TxIn at funding_inputs[{}]",
4697-
input.1.as_transaction().compute_txid(), input.0.previous_output.vout, idx) });
4698-
}
4699-
}
4700-
4701-
let funding_satoshis = total_input_satoshis.saturating_sub(estimated_fee);
4702-
if funding_satoshis < holder_dust_limit_satoshis {
4703-
Ok(0)
4704-
} else {
4705-
Ok(funding_satoshis)
4706-
}
4707-
}
4708-
47094682
/// Verify that the provided inputs by a counterparty to the funding transaction are enough
47104683
/// to cover the intended contribution amount *plus* the proportional fees of the counterparty.
47114684
/// Fees are computed using `estimate_v2_funding_transaction_fee`, and contain
@@ -9932,7 +9905,6 @@ impl<SP: Deref> PendingV2Channel<SP> where SP::Target: SignerProvider {
99329905
/// Creates a new dual-funded channel from a remote side's request for one.
99339906
/// Assumes chain_hash has already been checked and corresponds with what we expect!
99349907
/// TODO(dual_funding): Allow contributions, pass intended amount and inputs
9935-
/// TODO(dual_funding): Include witness weight info with the inputs.
99369908
#[allow(dead_code)] // TODO(dual_funding): Remove once V2 channels is enabled.
99379909
pub fn new_inbound<ES: Deref, F: Deref, L: Deref>(
99389910
fee_estimator: &LowerBoundedFeeEstimator<F>, entropy_source: &ES, signer_provider: &SP,

lightning/src/ln/channelmanager.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ use bitcoin::hash_types::{BlockHash, Txid};
3030

3131
use bitcoin::secp256k1::{SecretKey,PublicKey};
3232
use bitcoin::secp256k1::Secp256k1;
33-
use bitcoin::{secp256k1, Sequence, TxIn, Weight};
33+
use bitcoin::{secp256k1, Sequence};
34+
#[cfg(splicing)]
35+
use bitcoin::{TxIn, Weight};
36+
3437

3538
use crate::events::FundingInfo;
3639
use crate::blinded_path::message::{AsyncPaymentsContext, MessageContext, OffersContext};
@@ -11907,7 +11910,6 @@ where
1190711910
});
1190811911
}
1190911912

11910-
/// TODO(splicing): Implement persisting
1191111913
#[cfg(splicing)]
1191211914
fn handle_splice_init(&self, counterparty_node_id: PublicKey, msg: &msgs::SpliceInit) {
1191311915
let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {
@@ -11922,7 +11924,6 @@ where
1192211924
});
1192311925
}
1192411926

11925-
/// TODO(splicing): Implement persisting
1192611927
#[cfg(splicing)]
1192711928
fn handle_splice_ack(&self, counterparty_node_id: PublicKey, msg: &msgs::SpliceAck) {
1192811929
let _persistence_guard = PersistenceNotifierGuard::optionally_notify(self, || {

0 commit comments

Comments
 (0)