- assert(ChannelDetails_get_outbound_capacity_msat(channel) == 40000*1000 - 1000);
- assert(ChannelDetails_get_inbound_capacity_msat(channel) == 1000);
+ assert(ChannelDetails_get_outbound_capacity_msat(channel) ==
+ 40000*1000 - 1000 - 1000 * ChannelCounterparty_get_unspendable_punishment_reserve(&counterparty));
+ int64_t inbound_capacity = ((int64_t)1000) - ChannelCounterparty_get_unspendable_punishment_reserve(&counterparty);
+ if (inbound_capacity < 0) inbound_capacity = 0;
+ assert(ChannelDetails_get_inbound_capacity_msat(channel) == (uint64_t)inbound_capacity);