File tree Expand file tree Collapse file tree
app/src/main/java/to/bitkit/ext Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,18 +8,18 @@ import org.lightningdevkit.ldknode.MaxDustHtlcExposure
88 * Calculates our total balance in the channel (see `value_to_self_msat` in rust-lightning).
99 *
1010 * This represents the amount we would receive if the channel closes now (excluding fees).
11- * Matches ldk-node's `ClaimableOnChannelClose.amountSatoshis` (excluding HTLCs).
11+ * Approximates ldk-node's `ClaimableOnChannelClose.amountSatoshis` (excluding HTLCs).
1212 *
13- * Formula: outbound_capacity + counterparty_reserve
13+ * Formula: outbound_capacity + our_reserve
1414 * - outbound_capacity: What we can spend now over Lightning
15- * - counterparty_reserve: Their reserve that comes back to us on close
15+ * - our_reserve: Our reserve that we get back on close
1616 */
1717val ChannelDetails .amountOnClose: ULong
1818 get() {
1919 val outboundCapacitySat = this .outboundCapacityMsat / 1000u
20- val counterpartyReserve = this .counterpartyUnspendablePunishmentReserve
20+ val ourReserve = this .unspendablePunishmentReserve ? : 0u
2121
22- return outboundCapacitySat + counterpartyReserve
22+ return outboundCapacitySat + ourReserve
2323 }
2424
2525/* * Returns only `open` channels, filtering out pending ones. */
You can’t perform that action at this time.
0 commit comments