Skip to content

Commit 030097f

Browse files
committed
Remove splicing-specific part (a parameter)
1 parent a653a5e commit 030097f

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
@@ -2132,17 +2132,12 @@ impl<SP: Deref> PendingV2Channel<SP> where SP::Target: SignerProvider {
21322132
#[allow(dead_code)] // TODO(dual_funding): Remove once contribution to V2 channels is enabled
21332133
fn begin_interactive_funding_tx_construction<ES: Deref>(
21342134
&mut self, signer_provider: &SP, entropy_source: &ES, holder_node_id: PublicKey,
2135-
prev_funding_input: Option<(TxIn, TransactionU16LenLimited)>,
21362135
) -> Result<Option<InteractiveTxMessageSend>, APIError>
21372136
where ES::Target: EntropySource
21382137
{
21392138
let mut funding_inputs = Vec::new();
21402139
mem::swap(&mut self.dual_funding_context.our_funding_inputs, &mut funding_inputs);
21412140

2142-
if let Some(prev_funding_input) = prev_funding_input {
2143-
funding_inputs.push(prev_funding_input);
2144-
}
2145-
21462141
let funding_inputs_prev_outputs = DualFundingChannelContext::txouts_from_input_prev_txs(&funding_inputs)
21472142
.map_err(|err| APIError::APIMisuseError { err: err.to_string() })?;
21482143

lightning/src/ln/interactivetxs.rs

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

0 commit comments

Comments
 (0)