@@ -224,6 +224,8 @@ pub struct CommonOpenChannelFields {
224
224
pub to_self_delay : u16 ,
225
225
/// The maximum number of inbound HTLCs towards channel initiator
226
226
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 ,
227
229
/// The channel initiator's key controlling the funding transaction
228
230
pub funding_pubkey : PublicKey ,
229
231
/// Used to derive a revocation key for transactions broadcast by counterparty
@@ -259,6 +261,7 @@ impl CommonOpenChannelFields {
259
261
commitment_feerate_sat_per_1000_weight : self . commitment_feerate_sat_per_1000_weight ,
260
262
to_self_delay : self . to_self_delay ,
261
263
max_accepted_htlcs : self . max_accepted_htlcs ,
264
+ channel_reserve_satoshis : self . channel_reserve_satoshis ,
262
265
}
263
266
}
264
267
}
@@ -282,6 +285,8 @@ pub struct ChannelParameters {
282
285
pub to_self_delay : u16 ,
283
286
/// The maximum number of pending HTLCs towards the channel initiator.
284
287
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 ,
285
290
}
286
291
287
292
/// An [`open_channel`] message to be sent to or received from a peer.
@@ -3016,6 +3021,7 @@ impl LengthReadable for OpenChannel {
3016
3021
commitment_feerate_sat_per_1000_weight,
3017
3022
to_self_delay,
3018
3023
max_accepted_htlcs,
3024
+ channel_reserve_satoshis,
3019
3025
funding_pubkey,
3020
3026
revocation_basepoint,
3021
3027
payment_basepoint,
@@ -3072,6 +3078,7 @@ impl LengthReadable for OpenChannelV2 {
3072
3078
let dust_limit_satoshis: u64 = Readable :: read ( r) ?;
3073
3079
let max_htlc_value_in_flight_msat: u64 = Readable :: read ( r) ?;
3074
3080
let htlc_minimum_msat: u64 = Readable :: read ( r) ?;
3081
+ let channel_reserve_satoshis: u64 = Readable :: read ( r) ?;
3075
3082
let to_self_delay: u16 = Readable :: read ( r) ?;
3076
3083
let max_accepted_htlcs: u16 = Readable :: read ( r) ?;
3077
3084
let locktime: u32 = Readable :: read ( r) ?;
@@ -3103,6 +3110,7 @@ impl LengthReadable for OpenChannelV2 {
3103
3110
commitment_feerate_sat_per_1000_weight,
3104
3111
to_self_delay,
3105
3112
max_accepted_htlcs,
3113
+ channel_reserve_satoshis,
3106
3114
funding_pubkey,
3107
3115
revocation_basepoint,
3108
3116
payment_basepoint,
@@ -3523,7 +3531,8 @@ where
3523
3531
} ) ,
3524
3532
} => {
3525
3533
if amt. is_some ( )
3526
- || cltv_value. is_some ( ) || total_msat. is_some ( )
3534
+ || cltv_value. is_some ( )
3535
+ || total_msat. is_some ( )
3527
3536
|| keysend_preimage. is_some ( )
3528
3537
|| invoice_request. is_some ( )
3529
3538
{
@@ -3673,7 +3682,8 @@ where
3673
3682
} ) ,
3674
3683
} => {
3675
3684
if amt. is_some ( )
3676
- || cltv_value. is_some ( ) || total_msat. is_some ( )
3685
+ || cltv_value. is_some ( )
3686
+ || total_msat. is_some ( )
3677
3687
|| keysend_preimage. is_some ( )
3678
3688
|| invoice_request. is_some ( )
3679
3689
{
@@ -4708,6 +4718,7 @@ mod tests {
4708
4718
commitment_feerate_sat_per_1000_weight : 821716 ,
4709
4719
to_self_delay : 49340 ,
4710
4720
max_accepted_htlcs : 49340 ,
4721
+ channel_reserve_satoshis : 8665828695742877976 ,
4711
4722
funding_pubkey : pubkey_1,
4712
4723
revocation_basepoint : pubkey_2,
4713
4724
payment_basepoint : pubkey_3,
@@ -4816,6 +4827,7 @@ mod tests {
4816
4827
htlc_minimum_msat : 2316138423780173 ,
4817
4828
to_self_delay : 49340 ,
4818
4829
max_accepted_htlcs : 49340 ,
4830
+ channel_reserve_satoshis : 8665828695742877976 ,
4819
4831
funding_pubkey : pubkey_1,
4820
4832
revocation_basepoint : pubkey_2,
4821
4833
payment_basepoint : pubkey_3,
0 commit comments