Skip to content

Commit 960dad4

Browse files
committed
Merge branch 'master' into fix/all-warnings
2 parents 319e4ce + f218ff9 commit 960dad4

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

app/src/main/java/to/bitkit/ext/ChannelDetails.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff 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
*/
1717
val 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. */

0 commit comments

Comments
 (0)