@@ -4679,33 +4679,6 @@ fn estimate_v2_funding_transaction_fee(
4679
4679
fee_for_weight(funding_feerate_sat_per_1000_weight, weight)
4680
4680
}
4681
4681
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
-
4709
4682
/// Verify that the provided inputs by a counterparty to the funding transaction are enough
4710
4683
/// to cover the intended contribution amount *plus* the proportional fees of the counterparty.
4711
4684
/// Fees are computed using `estimate_v2_funding_transaction_fee`, and contain
@@ -9932,7 +9905,6 @@ impl<SP: Deref> PendingV2Channel<SP> where SP::Target: SignerProvider {
9932
9905
/// Creates a new dual-funded channel from a remote side's request for one.
9933
9906
/// Assumes chain_hash has already been checked and corresponds with what we expect!
9934
9907
/// TODO(dual_funding): Allow contributions, pass intended amount and inputs
9935
- /// TODO(dual_funding): Include witness weight info with the inputs.
9936
9908
#[allow(dead_code)] // TODO(dual_funding): Remove once V2 channels is enabled.
9937
9909
pub fn new_inbound<ES: Deref, F: Deref, L: Deref>(
9938
9910
fee_estimator: &LowerBoundedFeeEstimator<F>, entropy_source: &ES, signer_provider: &SP,
0 commit comments