Skip to content

Commit 77e62a0

Browse files
ben-kaufmanclaude
andcommitted
fix: use satsCeil for LNURL display amounts to match BOLT11 behavior
Previously LNURL-pay showed 222 sats on review but 223 after sending, and LNURL-withdraw showed 222 while BOLT11 showed 223 for the same 222222 msat amount. Use ceiling division consistently for display. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2a8037d commit 77e62a0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,7 +1469,7 @@ class AppViewModel @Inject constructor(
14691469
Logger.debug("LNURL: $data", context = TAG)
14701470

14711471
val isFixed = data.isFixedAmount()
1472-
val displaySats = if (isFixed) data.maxSendableSat() else data.minSendableSat()
1472+
val displaySats = data.minSendableSat()
14731473

14741474
if (!lightningRepo.canSend(displaySats.coerceAtLeast(1u))) {
14751475
toast(
@@ -1528,7 +1528,7 @@ class AppViewModel @Inject constructor(
15281528
return
15291529
}
15301530

1531-
val displayAmount = if (isFixed) data.fixedWithdrawAmountSat() else minWithdrawable
1531+
val displayAmount = if (isFixed) data.minWithdrawableSat() else minWithdrawable
15321532

15331533
_sendUiState.update {
15341534
it.copy(

0 commit comments

Comments
 (0)