@@ -210,7 +210,10 @@ pub struct ChannelDetails {
210
210
/// [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
211
211
pub counterparty_unspendable_punishment_reserve : u64 ,
212
212
/// The smallest value HTLC (in msat) the remote peer will accept, for this channel.
213
- pub counterparty_outbound_htlc_minimum_msat : u64 ,
213
+ ///
214
+ /// This field is only `None` before we have received either the `OpenChannel` or
215
+ /// `AcceptChannel` message from the remote peer.
216
+ pub counterparty_outbound_htlc_minimum_msat : Option < u64 > ,
214
217
/// The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
215
218
pub counterparty_outbound_htlc_maximum_msat : Option < u64 > ,
216
219
/// Base routing fee in millisatoshis.
@@ -258,6 +261,8 @@ impl From<LdkChannelDetails> for ChannelDetails {
258
261
channel_value_sats : value. channel_value_satoshis ,
259
262
unspendable_punishment_reserve : value. unspendable_punishment_reserve ,
260
263
user_channel_id : UserChannelId ( value. user_channel_id ) ,
264
+ // unwrap safety: This value will be `None` for objects serialized with LDK versions
265
+ // prior to 0.0.115.
261
266
feerate_sat_per_1000_weight : value. feerate_sat_per_1000_weight . unwrap ( ) ,
262
267
balance_msat : value. balance_msat ,
263
268
outbound_capacity_msat : value. outbound_capacity_msat ,
@@ -272,10 +277,7 @@ impl From<LdkChannelDetails> for ChannelDetails {
272
277
counterparty_unspendable_punishment_reserve : value
273
278
. counterparty
274
279
. unspendable_punishment_reserve ,
275
- counterparty_outbound_htlc_minimum_msat : value
276
- . counterparty
277
- . outbound_htlc_minimum_msat
278
- . unwrap ( ) ,
280
+ counterparty_outbound_htlc_minimum_msat : value. counterparty . outbound_htlc_minimum_msat ,
279
281
counterparty_outbound_htlc_maximum_msat : value. counterparty . outbound_htlc_maximum_msat ,
280
282
counterparty_forwarding_info_fee_base_msat : value
281
283
. counterparty
@@ -295,8 +297,10 @@ impl From<LdkChannelDetails> for ChannelDetails {
295
297
next_outbound_htlc_limit_msat : value. next_outbound_htlc_limit_msat ,
296
298
next_outbound_htlc_minimum_msat : value. next_outbound_htlc_minimum_msat ,
297
299
force_close_spend_delay : value. force_close_spend_delay ,
298
- inbound_htlc_minimum_msat : value. inbound_htlc_minimum_msat . unwrap ( ) ,
300
+ // unwrap safety: This field is only `None` for objects serialized prior to LDK 0.0.107
301
+ inbound_htlc_minimum_msat : value. inbound_htlc_minimum_msat . unwrap_or ( 0 ) ,
299
302
inbound_htlc_maximum_msat : value. inbound_htlc_maximum_msat ,
303
+ // unwrap safety: `config` is only `None` for LDK objects serialized prior to 0.0.109.
300
304
config : value. config . map ( |c| Arc :: new ( c. into ( ) ) ) . unwrap ( ) ,
301
305
}
302
306
}
0 commit comments