@@ -2,7 +2,7 @@ import { getPaymentFailureStatus, hodlInvoiceCltvDetails, getPaymentOrNotSent }
2
2
import { paidActions } from '@/api/paidAction'
3
3
import { walletLogger } from '@/api/resolvers/wallet'
4
4
import { LND_PATHFINDING_TIME_PREF_PPM , LND_PATHFINDING_TIMEOUT_MS , PAID_ACTION_TERMINAL_STATES } from '@/lib/constants'
5
- import { formatMsats , formatSats , msatsToSats , toPositiveNumber } from '@/lib/format'
5
+ import { formatSats , msatsToSats , toPositiveNumber } from '@/lib/format'
6
6
import { datePivot } from '@/lib/time'
7
7
import { Prisma } from '@prisma/client'
8
8
import {
@@ -317,17 +317,13 @@ export async function paidActionForwarded ({ data: { invoiceId, withdrawal, ...a
317
317
} , { models, lnd, boss } )
318
318
319
319
if ( transitionedInvoice ) {
320
- const { bolt11 , msatsPaid } = transitionedInvoice . invoiceForward . withdrawl
320
+ const withdrawal = transitionedInvoice . invoiceForward . withdrawl
321
321
322
322
const logger = walletLogger ( { wallet : transitionedInvoice . invoiceForward . wallet , models } )
323
323
logger . ok (
324
- `↙ payment received: ${ formatSats ( msatsToSats ( Number ( msatsPaid ) ) ) } ` ,
325
- {
326
- bolt11,
327
- preimage : transitionedInvoice . preimage
328
- // we could show the outgoing fee that we paid from the incoming amount to the receiver
329
- // but we don't since it might look like the receiver paid the fee but that's not the case.
330
- // fee: formatMsats(msatsFeePaid)
324
+ `↙ payment received: ${ formatSats ( msatsToSats ( Number ( withdrawal . msatsPaid ) ) ) } ` , {
325
+ invoiceId : transitionedInvoice . id ,
326
+ withdrawalId : withdrawal . id
331
327
} )
332
328
}
333
329
@@ -376,12 +372,11 @@ export async function paidActionFailedForward ({ data: { invoiceId, withdrawal:
376
372
} , { models, lnd, boss } )
377
373
378
374
if ( transitionedInvoice ) {
379
- const { bolt11 , msatsFeePaying } = transitionedInvoice . invoiceForward . withdrawl
380
- const logger = walletLogger ( { wallet : transitionedInvoice . invoiceForward . wallet , models } )
375
+ const fwd = transitionedInvoice . invoiceForward
376
+ const logger = walletLogger ( { wallet : fwd . wallet , models } )
381
377
logger . warn (
382
378
`incoming payment failed: ${ message } ` , {
383
- bolt11,
384
- max_fee : formatMsats ( msatsFeePaying )
379
+ withdrawalId : fwd . withdrawl . id
385
380
} )
386
381
}
387
382
@@ -446,7 +441,10 @@ export async function paidActionCanceling ({ data: { invoiceId, ...args }, model
446
441
const { wallet, bolt11 } = transitionedInvoice . invoiceForward
447
442
const logger = walletLogger ( { wallet, models } )
448
443
const decoded = await parsePaymentRequest ( { request : bolt11 } )
449
- logger . info ( `invoice for ${ formatSats ( msatsToSats ( decoded . mtokens ) ) } canceled by payer` , { bolt11 } )
444
+ logger . info (
445
+ `invoice for ${ formatSats ( msatsToSats ( decoded . mtokens ) ) } canceled by payer` , {
446
+ invoiceId : transitionedInvoice . id
447
+ } )
450
448
}
451
449
}
452
450
0 commit comments