@@ -1513,6 +1513,7 @@ impl<SP: Deref> Channel<SP> where
1513
1513
};
1514
1514
let mut funded_channel = FundedChannel {
1515
1515
funding: chan.funding,
1516
+ pending_funding: vec![],
1516
1517
context: chan.context,
1517
1518
interactive_tx_signing_session: chan.interactive_tx_signing_session,
1518
1519
holder_commitment_point,
@@ -1657,6 +1658,30 @@ pub(super) struct FundingScope {
1657
1658
funding_transaction: Option<Transaction>,
1658
1659
}
1659
1660
1661
+ #[cfg(not(any(test, fuzzing)))]
1662
+ impl_writeable_tlv_based!(FundingScope, {
1663
+ (0, value_to_self_msat, required),
1664
+ (1, counterparty_selected_channel_reserve_satoshis, option),
1665
+ (2, holder_selected_channel_reserve_satoshis, required),
1666
+ (3, holder_max_commitment_tx_output, required),
1667
+ (4, counterparty_max_commitment_tx_output, required),
1668
+ (5, channel_transaction_parameters, (required: ReadableArgs, 0)), // FIXME: This won't work
1669
+ (6, funding_transaction, option),
1670
+ });
1671
+
1672
+ #[cfg(any(test, fuzzing))]
1673
+ impl_writeable_tlv_based!(FundingScope, {
1674
+ (0, value_to_self_msat, required),
1675
+ (1, counterparty_selected_channel_reserve_satoshis, option),
1676
+ (2, holder_selected_channel_reserve_satoshis, required),
1677
+ (3, holder_max_commitment_tx_output, required),
1678
+ (4, counterparty_max_commitment_tx_output, required),
1679
+ (5, channel_transaction_parameters, (required: ReadableArgs, 0)),
1680
+ (6, funding_transaction, option),
1681
+ (126, next_local_commitment_tx_fee_info_cached, required), // FIXME: This won't work
1682
+ (127, next_remote_commitment_tx_fee_info_cached, required), // FIXME: This won't work
1683
+ });
1684
+
1660
1685
impl FundingScope {
1661
1686
pub fn get_value_satoshis(&self) -> u64 {
1662
1687
self.channel_transaction_parameters.channel_value_satoshis
@@ -4820,6 +4845,7 @@ pub(super) struct DualFundingChannelContext {
4820
4845
// Counterparty designates channel data owned by the another channel participant entity.
4821
4846
pub(super) struct FundedChannel<SP: Deref> where SP::Target: SignerProvider {
4822
4847
pub funding: FundingScope,
4848
+ pending_funding: Vec<FundingScope>,
4823
4849
pub context: ChannelContext<SP>,
4824
4850
pub interactive_tx_signing_session: Option<InteractiveTxSigningSession>,
4825
4851
holder_commitment_point: HolderCommitmentPoint,
@@ -9278,6 +9304,7 @@ impl<SP: Deref> OutboundV1Channel<SP> where SP::Target: SignerProvider {
9278
9304
9279
9305
let mut channel = FundedChannel {
9280
9306
funding: self.funding,
9307
+ pending_funding: vec![],
9281
9308
context: self.context,
9282
9309
interactive_tx_signing_session: None,
9283
9310
is_v2_established: false,
@@ -9545,6 +9572,7 @@ impl<SP: Deref> InboundV1Channel<SP> where SP::Target: SignerProvider {
9545
9572
// `ChannelMonitor`.
9546
9573
let mut channel = FundedChannel {
9547
9574
funding: self.funding,
9575
+ pending_funding: vec![],
9548
9576
context: self.context,
9549
9577
interactive_tx_signing_session: None,
9550
9578
is_v2_established: false,
@@ -10330,6 +10358,7 @@ impl<SP: Deref> Writeable for FundedChannel<SP> where SP::Target: SignerProvider
10330
10358
(49, self.context.local_initiated_shutdown, option), // Added in 0.0.122
10331
10359
(51, is_manual_broadcast, option), // Added in 0.0.124
10332
10360
(53, funding_tx_broadcast_safe_event_emitted, option), // Added in 0.0.124
10361
+ (55, self.pending_funding, optional_vec), // Added in 0.2
10333
10362
});
10334
10363
10335
10364
Ok(())
@@ -10609,6 +10638,8 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, &'c Channel
10609
10638
let mut next_holder_commitment_point_opt: Option<PublicKey> = None;
10610
10639
let mut is_manual_broadcast = None;
10611
10640
10641
+ let mut pending_funding = Some(Vec::new());
10642
+
10612
10643
read_tlv_fields!(reader, {
10613
10644
(0, announcement_sigs, option),
10614
10645
(1, minimum_depth, option),
@@ -10644,6 +10675,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, &'c Channel
10644
10675
(49, local_initiated_shutdown, option),
10645
10676
(51, is_manual_broadcast, option),
10646
10677
(53, funding_tx_broadcast_safe_event_emitted, option),
10678
+ (55, pending_funding, optional_vec), // Added in 0.2
10647
10679
});
10648
10680
10649
10681
let holder_signer = signer_provider.derive_channel_signer(channel_keys_id);
@@ -10785,6 +10817,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, &'c Channel
10785
10817
channel_transaction_parameters: channel_parameters,
10786
10818
funding_transaction,
10787
10819
},
10820
+ pending_funding: pending_funding.unwrap(),
10788
10821
context: ChannelContext {
10789
10822
user_id,
10790
10823
0 commit comments