Skip to content

Commit fd526bc

Browse files
committed
truncate msats for autowithdraw failure check
1 parent a626a92 commit fd526bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

worker/autowithdraw.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { msatsSatsFloor, satsToMsats } from '@/lib/format'
1+
import { msatsSatsFloor, msatsToSats, satsToMsats } from '@/lib/format'
22
import pay from '@/api/payIn'
33

44
export async function autoWithdraw ({ data: { id }, models, lnd }) {
@@ -36,7 +36,7 @@ export async function autoWithdraw ({ data: { id }, models, lnd }) {
3636
AND status IS DISTINCT FROM 'CONFIRMED'
3737
AND "payOutType" = 'WITHDRAWAL'
3838
AND created_at > now() - interval '1 hour'
39-
AND "msats" >= ${msats}
39+
AND "msats" >= ${satsToMsats(msatsToSats(msats))}
4040
)`
4141

4242
if (pendingOrFailed.exists) return

0 commit comments

Comments
 (0)