Skip to content

Commit 32ac4c1

Browse files
committed
f make our_funding_inputs an Option
1 parent 72ec93b commit 32ac4c1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lightning/src/ln/channel.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,7 +1498,8 @@ pub(super) trait InteractivelyFunded<SP: Deref> where SP::Target: SignerProvider
14981498
self.dual_funding_context_mut().funding_feerate_sat_per_1000_weight,
14991499
holder_node_id, self.context().counterparty_node_id, self.is_initiator(),
15001500
self.dual_funding_context_mut().funding_tx_locktime,
1501-
self.dual_funding_context_mut().our_funding_inputs.clone(), funding_outputs,
1501+
self.dual_funding_context_mut().our_funding_inputs.take().unwrap_or_else(|| vec![]),
1502+
funding_outputs,
15021503
expected_remote_shared_funding_output,
15031504
).map_err(|_| APIError::APIMisuseError { err: "Incorrect shared output provided".into() })?;
15041505

@@ -3900,7 +3901,7 @@ pub(super) struct DualFundingChannelContext {
39003901
/// Note that the `our_funding_satoshis` field is equal to the total value of `our_funding_inputs`
39013902
/// minus any fees paid for our contributed weight. This means that change will never be generated
39023903
/// and the maximum value possible will go towards funding the channel.
3903-
pub our_funding_inputs: Vec<(TxIn, TransactionU16LenLimited)>,
3904+
pub our_funding_inputs: Option<Vec<(TxIn, TransactionU16LenLimited)>>,
39043905
}
39053906

39063907
// Holder designates channel data owned for the benefit of the user client.
@@ -8554,7 +8555,7 @@ impl<SP: Deref> OutboundV2Channel<SP> where SP::Target: SignerProvider {
85548555
their_funding_satoshis: None,
85558556
funding_tx_locktime,
85568557
funding_feerate_sat_per_1000_weight,
8557-
our_funding_inputs: funding_inputs,
8558+
our_funding_inputs: Some(funding_inputs),
85588559
},
85598560
#[cfg(any(dual_funding, splicing))]
85608561
interactive_tx_constructor: None,
@@ -8762,7 +8763,7 @@ impl<SP: Deref> InboundV2Channel<SP> where SP::Target: SignerProvider {
87628763
their_funding_satoshis: Some(msg.common_fields.funding_satoshis),
87638764
funding_tx_locktime: LockTime::from_consensus(msg.locktime),
87648765
funding_feerate_sat_per_1000_weight: msg.funding_feerate_sat_per_1000_weight,
8765-
our_funding_inputs: funding_inputs,
8766+
our_funding_inputs: Some(funding_inputs),
87668767
},
87678768
interactive_tx_constructor: None,
87688769
};

0 commit comments

Comments
 (0)