Skip to content

Commit ee9444b

Browse files
committed
Remove splicing-specific part (a parameter)
1 parent 56ae478 commit ee9444b

File tree

2 files changed

+0
-59
lines changed

2 files changed

+0
-59
lines changed

lightning/src/ln/channel.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2235,17 +2235,12 @@ impl<SP: Deref> PendingV2Channel<SP> where SP::Target: SignerProvider {
22352235
#[allow(dead_code)] // TODO(dual_funding): Remove once contribution to V2 channels is enabled
22362236
fn begin_interactive_funding_tx_construction<ES: Deref>(
22372237
&mut self, signer_provider: &SP, entropy_source: &ES, holder_node_id: PublicKey,
2238-
prev_funding_input: Option<(TxIn, TransactionU16LenLimited)>,
22392238
) -> Result<Option<InteractiveTxMessageSend>, APIError>
22402239
where ES::Target: EntropySource
22412240
{
22422241
let mut funding_inputs = Vec::new();
22432242
mem::swap(&mut self.dual_funding_context.our_funding_inputs, &mut funding_inputs);
22442243

2245-
if let Some(prev_funding_input) = prev_funding_input {
2246-
funding_inputs.push(prev_funding_input);
2247-
}
2248-
22492244
let funding_inputs_prev_outputs = DualFundingChannelContext::txouts_from_input_prev_txs(&funding_inputs)
22502245
.map_err(|err| APIError::APIMisuseError { err: err.to_string() })?;
22512246

lightning/src/ln/interactivetxs.rs

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2729,58 +2729,4 @@ mod tests {
27292729
assert_eq!(res.unwrap(), 154);
27302730
}
27312731
}
2732-
2733-
#[test]
2734-
fn test_calculate_change_output_value_splice() {
2735-
let input_prevouts_owned = vec![
2736-
TxOut { value: Amount::from_sat(70_000), script_pubkey: ScriptBuf::new() },
2737-
TxOut { value: Amount::from_sat(60_000), script_pubkey: ScriptBuf::new() },
2738-
];
2739-
let input_prevouts: Vec<&TxOut> = input_prevouts_owned.iter().collect();
2740-
let our_contributed = 110_000;
2741-
let txout = TxOut { value: Amount::from_sat(148_000), script_pubkey: ScriptBuf::new() };
2742-
let outputs = vec![OutputOwned::Shared(SharedOwnedOutput::new(txout, our_contributed))];
2743-
let funding_feerate_sat_per_1000_weight = 3000;
2744-
2745-
let total_inputs: u64 = input_prevouts.iter().map(|o| o.value.to_sat()).sum();
2746-
let gross_change = total_inputs - our_contributed;
2747-
let fees = 1746;
2748-
let common_fees = 126;
2749-
{
2750-
// There is leftover for change
2751-
let res = calculate_change_output_value(
2752-
true,
2753-
our_contributed,
2754-
&input_prevouts,
2755-
&outputs,
2756-
funding_feerate_sat_per_1000_weight,
2757-
300,
2758-
);
2759-
assert_eq!(res.unwrap(), gross_change - fees - common_fees);
2760-
}
2761-
{
2762-
// Very small leftover
2763-
let res = calculate_change_output_value(
2764-
false,
2765-
128_100,
2766-
&input_prevouts,
2767-
&outputs,
2768-
funding_feerate_sat_per_1000_weight,
2769-
300,
2770-
);
2771-
assert!(res.is_none());
2772-
}
2773-
{
2774-
// Small leftover, but not dust
2775-
let res = calculate_change_output_value(
2776-
false,
2777-
128_100,
2778-
&input_prevouts,
2779-
&outputs,
2780-
funding_feerate_sat_per_1000_weight,
2781-
100,
2782-
);
2783-
assert_eq!(res.unwrap(), 154);
2784-
}
2785-
}
27862732
}

0 commit comments

Comments
 (0)