@@ -1514,6 +1514,7 @@ impl<SP: Deref> Channel<SP> where
1514
1514
};
1515
1515
let mut funded_channel = FundedChannel {
1516
1516
funding: chan.funding,
1517
+ pending_funding: vec![],
1517
1518
context: chan.context,
1518
1519
interactive_tx_signing_session: chan.interactive_tx_signing_session,
1519
1520
holder_commitment_point,
@@ -1660,6 +1661,30 @@ pub(super) struct FundingScope {
1660
1661
funding_transaction: Option<Transaction>,
1661
1662
}
1662
1663
1664
+ #[cfg(not(any(test, fuzzing)))]
1665
+ impl_writeable_tlv_based!(FundingScope, {
1666
+ (0, value_to_self_msat, required),
1667
+ (1, counterparty_selected_channel_reserve_satoshis, option),
1668
+ (2, holder_selected_channel_reserve_satoshis, required),
1669
+ (3, holder_max_commitment_tx_output, required),
1670
+ (4, counterparty_max_commitment_tx_output, required),
1671
+ (5, channel_transaction_parameters, (required: ReadableArgs, 0)), // FIXME: This won't work
1672
+ (6, funding_transaction, option),
1673
+ });
1674
+
1675
+ #[cfg(any(test, fuzzing))]
1676
+ impl_writeable_tlv_based!(FundingScope, {
1677
+ (0, value_to_self_msat, required),
1678
+ (1, counterparty_selected_channel_reserve_satoshis, option),
1679
+ (2, holder_selected_channel_reserve_satoshis, required),
1680
+ (3, holder_max_commitment_tx_output, required),
1681
+ (4, counterparty_max_commitment_tx_output, required),
1682
+ (5, channel_transaction_parameters, (required: ReadableArgs, 0)),
1683
+ (6, funding_transaction, option),
1684
+ (126, next_local_commitment_tx_fee_info_cached, required), // FIXME: This won't work
1685
+ (127, next_remote_commitment_tx_fee_info_cached, required), // FIXME: This won't work
1686
+ });
1687
+
1663
1688
impl FundingScope {
1664
1689
pub fn get_value_satoshis(&self) -> u64 {
1665
1690
self.channel_transaction_parameters.channel_value_satoshis
@@ -4890,6 +4915,7 @@ pub(super) struct DualFundingChannelContext {
4890
4915
// Counterparty designates channel data owned by the another channel participant entity.
4891
4916
pub(super) struct FundedChannel<SP: Deref> where SP::Target: SignerProvider {
4892
4917
pub funding: FundingScope,
4918
+ pending_funding: Vec<FundingScope>,
4893
4919
pub context: ChannelContext<SP>,
4894
4920
pub interactive_tx_signing_session: Option<InteractiveTxSigningSession>,
4895
4921
holder_commitment_point: HolderCommitmentPoint,
@@ -9472,6 +9498,7 @@ impl<SP: Deref> OutboundV1Channel<SP> where SP::Target: SignerProvider {
9472
9498
9473
9499
let mut channel = FundedChannel {
9474
9500
funding: self.funding,
9501
+ pending_funding: vec![],
9475
9502
context: self.context,
9476
9503
interactive_tx_signing_session: None,
9477
9504
is_v2_established: false,
@@ -9748,6 +9775,7 @@ impl<SP: Deref> InboundV1Channel<SP> where SP::Target: SignerProvider {
9748
9775
// `ChannelMonitor`.
9749
9776
let mut channel = FundedChannel {
9750
9777
funding: self.funding,
9778
+ pending_funding: vec![],
9751
9779
context: self.context,
9752
9780
interactive_tx_signing_session: None,
9753
9781
is_v2_established: false,
@@ -10542,6 +10570,7 @@ impl<SP: Deref> Writeable for FundedChannel<SP> where SP::Target: SignerProvider
10542
10570
(49, self.context.local_initiated_shutdown, option), // Added in 0.0.122
10543
10571
(51, is_manual_broadcast, option), // Added in 0.0.124
10544
10572
(53, funding_tx_broadcast_safe_event_emitted, option), // Added in 0.0.124
10573
+ (55, self.pending_funding, optional_vec), // Added in 0.2
10545
10574
});
10546
10575
10547
10576
Ok(())
@@ -10833,6 +10862,8 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, &'c Channel
10833
10862
let mut next_holder_commitment_point_opt: Option<PublicKey> = None;
10834
10863
let mut is_manual_broadcast = None;
10835
10864
10865
+ let mut pending_funding = Some(Vec::new());
10866
+
10836
10867
read_tlv_fields!(reader, {
10837
10868
(0, announcement_sigs, option),
10838
10869
(1, minimum_depth, option),
@@ -10868,6 +10899,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, &'c Channel
10868
10899
(49, local_initiated_shutdown, option),
10869
10900
(51, is_manual_broadcast, option),
10870
10901
(53, funding_tx_broadcast_safe_event_emitted, option),
10902
+ (55, pending_funding, optional_vec), // Added in 0.2
10871
10903
});
10872
10904
10873
10905
let holder_signer = signer_provider.derive_channel_signer(channel_keys_id);
@@ -11009,6 +11041,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, &'c Channel
11009
11041
channel_transaction_parameters: channel_parameters,
11010
11042
funding_transaction,
11011
11043
},
11044
+ pending_funding: pending_funding.unwrap(),
11012
11045
context: ChannelContext {
11013
11046
user_id,
11014
11047
0 commit comments