Skip to content

Commit 98e8dc5

Browse files
committed
Remove splicing-specific part (a parameter)
1 parent b0c597c commit 98e8dc5

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
@@ -2243,17 +2243,12 @@ impl<SP: Deref> PendingV2Channel<SP> where SP::Target: SignerProvider {
22432243
#[allow(dead_code)] // TODO(dual_funding): Remove once contribution to V2 channels is enabled
22442244
fn begin_interactive_funding_tx_construction<ES: Deref>(
22452245
&mut self, signer_provider: &SP, entropy_source: &ES, holder_node_id: PublicKey,
2246-
prev_funding_input: Option<(TxIn, TransactionU16LenLimited)>,
22472246
) -> Result<Option<InteractiveTxMessageSend>, APIError>
22482247
where ES::Target: EntropySource
22492248
{
22502249
let mut funding_inputs = Vec::new();
22512250
mem::swap(&mut self.dual_funding_context.our_funding_inputs, &mut funding_inputs);
22522251

2253-
if let Some(prev_funding_input) = prev_funding_input {
2254-
funding_inputs.push(prev_funding_input);
2255-
}
2256-
22572252
let funding_inputs_prev_outputs = DualFundingChannelContext::txouts_from_input_prev_txs(&funding_inputs)
22582253
.map_err(|err| APIError::APIMisuseError { err: err.to_string() })?;
22592254

lightning/src/ln/interactivetxs.rs

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

0 commit comments

Comments
 (0)