Skip to content

Commit c0a55b4

Browse files
committed
Remove impossible logger
1 parent 867243d commit c0a55b4

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

worker/payingAction.js

+3-20
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { getPaymentFailureStatus, getPaymentOrNotSent } from '@/api/lnd'
2-
import { walletLogger } from '@/api/resolvers/wallet'
3-
import { formatSats, msatsToSats, toPositiveBigInt } from '@/lib/format'
2+
import { msatsToSats, toPositiveBigInt } from '@/lib/format'
43
import { datePivot } from '@/lib/time'
54
import { notifyWithdrawal } from '@/lib/webPush'
65
import { Prisma } from '@prisma/client'
@@ -122,18 +121,11 @@ export async function payingActionConfirmed ({ data: args, models, lnd, boss })
122121

123122
if (transitionedWithdrawal) {
124123
await notifyWithdrawal(transitionedWithdrawal)
125-
126-
const logger = walletLogger({ models, wallet: transitionedWithdrawal.wallet })
127-
logger?.ok(`↙ payment received: ${formatSats(msatsToSats(transitionedWithdrawal.msatsPaid))}`, {
128-
// TODO: test this
129-
invoiceId: transitionedWithdrawal.invoiceForward.invoice.id
130-
})
131124
}
132125
}
133126

134127
export async function payingActionFailed ({ data: args, models, lnd, boss }) {
135-
let message
136-
const transitionedWithdrawal = await transitionWithdrawal('payingActionFailed', {
128+
await transitionWithdrawal('payingActionFailed', {
137129
toStatus: 'UNKNOWN_FAILURE',
138130
...args,
139131
transition: async ({ dbWithdrawal, lndWithdrawal, tx }) => {
@@ -151,21 +143,12 @@ export async function payingActionFailed ({ data: args, models, lnd, boss }) {
151143
console.log(`user refunded ${msatsToSats(dbWithdrawal.msatsFeePaying + dbWithdrawal.msatsPaying)} sats`)
152144

153145
// update to particular status
154-
const { status, message: failureMessage } = getPaymentFailureStatus(lndWithdrawal)
155-
message = failureMessage
146+
const { status } = getPaymentFailureStatus(lndWithdrawal)
156147

157148
console.log('withdrawal failed with status', status)
158149
return {
159150
status
160151
}
161152
}
162153
}, { models, lnd, boss })
163-
164-
if (transitionedWithdrawal) {
165-
const logger = walletLogger({ models, wallet: transitionedWithdrawal.wallet })
166-
logger?.error(`incoming payment failed: ${message}`, {
167-
// TODO: test this
168-
invoiceId: transitionedWithdrawal.invoiceForward.invoice.id
169-
})
170-
}
171154
}

0 commit comments

Comments
 (0)