Skip to content

Commit

Permalink
Remove duplicate autowithdrawal log
Browse files Browse the repository at this point in the history
  • Loading branch information
ekzyis committed Nov 5, 2024
1 parent 3f284db commit bef63a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
4 changes: 2 additions & 2 deletions api/resolvers/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -878,8 +878,8 @@ export async function createWithdrawal (parent, { invoice, maxFee }, { me, model
// can't use max_fee_mtokens https://github.com/alexbosworth/ln-service/issues/141
max_fee: Number(maxFee),
pathfinding_timeout: LND_PATHFINDING_TIMEOUT_MS
}).then(() => {
return logger?.ok(`↙ payment received: ${formatMsats(decoded.mtokens)}`)
}).then((result) => {
return logger?.ok(`↙ payment received: ${formatMsats(decoded.mtokens)} with ${formatMsats(Number(result.fee_mtokens))} as fee`)
}).catch(err => {
return logger?.error('withdrawal failed:', err.message)
})
Expand Down
8 changes: 0 additions & 8 deletions worker/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { INVOICE_RETENTION_DAYS, LND_PATHFINDING_TIMEOUT_MS } from '@/lib/consta
import { datePivot, sleep } from '@/lib/time.js'
import retry from 'async-retry'
import { walletLogger } from '@/api/resolvers/wallet'
import { msatsToSats, numWithUnits } from '@/lib/format'
import {
paidActionPaid, paidActionForwarded,
paidActionFailedForward, paidActionHeld, paidActionFailed,
Expand Down Expand Up @@ -307,13 +306,6 @@ export async function checkWithdrawal ({ data: { hash, withdrawal, invoice }, bo
], { models })
if (code === 0) {
notifyWithdrawal(dbWdrwl.userId, wdrwl)
if (dbWdrwl.wallet) {
// this was an autowithdrawal
const message = `autowithdrawal of ${
numWithUnits(msatsToSats(paid), { abbreviate: false })} with ${
numWithUnits(msatsToSats(fee), { abbreviate: false })} as fee`
await logger.ok(message)
}
}
} else if (wdrwl?.is_failed || notSent) {
if (dbWdrwl.invoiceForward.length > 0) {
Expand Down

0 comments on commit bef63a7

Please sign in to comment.