From 1cbbd65adb08beb768e097bf10cd528c8a5c8eae Mon Sep 17 00:00:00 2001 From: M1 Date: Wed, 18 Mar 2026 23:33:47 +0400 Subject: [PATCH] =?UTF-8?q?fix:=20compare=20floats=20to=20floats=20in=20ch?= =?UTF-8?q?eckPending=20=E2=80=94=20was=20comparing=20sats=20vs=20floats,?= =?UTF-8?q?=20always=20false?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/pay/src/monitor.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/pay/src/monitor.ts b/apps/pay/src/monitor.ts index da78c3c..12ede7f 100644 --- a/apps/pay/src/monitor.ts +++ b/apps/pay/src/monitor.ts @@ -207,8 +207,9 @@ async function checkPending(payment: any) { const coin = COINS[payment.coin]; if (!coin) return; - const expectedSats = cryptoToSats(payment.coin, payment.amount_crypto); - const threshold = expectedSats * 0.995; + const multiplier = payment.coin === "xec" ? 100 : 1e8; + const expectedCrypto = parseFloat(payment.amount_crypto); + const threshold = expectedCrypto * 0.995; const confirmed = sumReceived(info, true); const total = sumReceived(info, false);