@@ -224,6 +224,8 @@ pub struct CommonOpenChannelFields {
224224 pub to_self_delay : u16 ,
225225 /// The maximum number of inbound HTLCs towards channel initiator
226226 pub max_accepted_htlcs : u16 ,
227+ /// The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
228+ pub channel_reserve_satoshis : u64 ,
227229 /// The channel initiator's key controlling the funding transaction
228230 pub funding_pubkey : PublicKey ,
229231 /// Used to derive a revocation key for transactions broadcast by counterparty
@@ -259,6 +261,7 @@ impl CommonOpenChannelFields {
259261 commitment_feerate_sat_per_1000_weight : self . commitment_feerate_sat_per_1000_weight ,
260262 to_self_delay : self . to_self_delay ,
261263 max_accepted_htlcs : self . max_accepted_htlcs ,
264+ channel_reserve_satoshis : self . channel_reserve_satoshis ,
262265 }
263266 }
264267}
@@ -282,6 +285,8 @@ pub struct ChannelParameters {
282285 pub to_self_delay : u16 ,
283286 /// The maximum number of pending HTLCs towards the channel initiator.
284287 pub max_accepted_htlcs : u16 ,
288+ /// The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
289+ pub channel_reserve_satoshis : u64 ,
285290}
286291
287292/// An [`open_channel`] message to be sent to or received from a peer.
@@ -3016,6 +3021,7 @@ impl LengthReadable for OpenChannel {
30163021 commitment_feerate_sat_per_1000_weight,
30173022 to_self_delay,
30183023 max_accepted_htlcs,
3024+ channel_reserve_satoshis,
30193025 funding_pubkey,
30203026 revocation_basepoint,
30213027 payment_basepoint,
@@ -3072,6 +3078,7 @@ impl LengthReadable for OpenChannelV2 {
30723078 let dust_limit_satoshis: u64 = Readable :: read ( r) ?;
30733079 let max_htlc_value_in_flight_msat: u64 = Readable :: read ( r) ?;
30743080 let htlc_minimum_msat: u64 = Readable :: read ( r) ?;
3081+ let channel_reserve_satoshis: u64 = Readable :: read ( r) ?;
30753082 let to_self_delay: u16 = Readable :: read ( r) ?;
30763083 let max_accepted_htlcs: u16 = Readable :: read ( r) ?;
30773084 let locktime: u32 = Readable :: read ( r) ?;
@@ -3103,6 +3110,7 @@ impl LengthReadable for OpenChannelV2 {
31033110 commitment_feerate_sat_per_1000_weight,
31043111 to_self_delay,
31053112 max_accepted_htlcs,
3113+ channel_reserve_satoshis,
31063114 funding_pubkey,
31073115 revocation_basepoint,
31083116 payment_basepoint,
@@ -3523,7 +3531,8 @@ where
35233531 } ) ,
35243532 } => {
35253533 if amt. is_some ( )
3526- || cltv_value. is_some ( ) || total_msat. is_some ( )
3534+ || cltv_value. is_some ( )
3535+ || total_msat. is_some ( )
35273536 || keysend_preimage. is_some ( )
35283537 || invoice_request. is_some ( )
35293538 {
@@ -3673,7 +3682,8 @@ where
36733682 } ) ,
36743683 } => {
36753684 if amt. is_some ( )
3676- || cltv_value. is_some ( ) || total_msat. is_some ( )
3685+ || cltv_value. is_some ( )
3686+ || total_msat. is_some ( )
36773687 || keysend_preimage. is_some ( )
36783688 || invoice_request. is_some ( )
36793689 {
@@ -4708,6 +4718,7 @@ mod tests {
47084718 commitment_feerate_sat_per_1000_weight : 821716 ,
47094719 to_self_delay : 49340 ,
47104720 max_accepted_htlcs : 49340 ,
4721+ channel_reserve_satoshis : 8665828695742877976 ,
47114722 funding_pubkey : pubkey_1,
47124723 revocation_basepoint : pubkey_2,
47134724 payment_basepoint : pubkey_3,
@@ -4816,6 +4827,7 @@ mod tests {
48164827 htlc_minimum_msat : 2316138423780173 ,
48174828 to_self_delay : 49340 ,
48184829 max_accepted_htlcs : 49340 ,
4830+ channel_reserve_satoshis : 8665828695742877976 ,
48194831 funding_pubkey : pubkey_1,
48204832 revocation_basepoint : pubkey_2,
48214833 payment_basepoint : pubkey_3,
0 commit comments