prioritize payment reliability
This commit is contained in:
parent
0e765d4179
commit
98fae6c9ae
|
@ -1,4 +1,4 @@
|
|||
import { LND_PATHFINDING_TIMEOUT_MS } from '@/lib/constants'
|
||||
import { LND_PATHFINDING_TIME_PREF_PPM, LND_PATHFINDING_TIMEOUT_MS } from '@/lib/constants'
|
||||
import { msatsToSats, satsToMsats, toPositiveBigInt } from '@/lib/format'
|
||||
import { Prisma } from '@prisma/client'
|
||||
import { parsePaymentRequest, payViaPaymentRequest } from 'ln-service'
|
||||
|
@ -44,7 +44,8 @@ export default async function performPayingAction ({ bolt11, maxFee, walletId },
|
|||
lnd,
|
||||
request: withdrawal.bolt11,
|
||||
max_fee: msatsToSats(withdrawal.msatsFeePaying),
|
||||
pathfinding_timeout: LND_PATHFINDING_TIMEOUT_MS
|
||||
pathfinding_timeout: LND_PATHFINDING_TIMEOUT_MS,
|
||||
confidence: LND_PATHFINDING_TIME_PREF_PPM
|
||||
}).catch(console.error)
|
||||
|
||||
return withdrawal
|
||||
|
|
|
@ -79,6 +79,7 @@ export const ANON_FEE_MULTIPLIER = 100
|
|||
export const SSR = typeof window === 'undefined'
|
||||
export const MAX_FORWARDS = 5
|
||||
export const LND_PATHFINDING_TIMEOUT_MS = 30000
|
||||
export const LND_PATHFINDING_TIME_PREF_PPM = 1e6 // optimize for reliability over fees
|
||||
export const LNURLP_COMMENT_MAX_LENGTH = 1000
|
||||
// https://github.com/lightning/bolts/issues/236
|
||||
export const MAX_INVOICE_DESCRIPTION_LENGTH = 640
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { getPaymentFailureStatus, hodlInvoiceCltvDetails, getPaymentOrNotSent } from '@/api/lnd'
|
||||
import { paidActions } from '@/api/paidAction'
|
||||
import { walletLogger } from '@/api/resolvers/wallet'
|
||||
import { LND_PATHFINDING_TIMEOUT_MS, PAID_ACTION_TERMINAL_STATES } from '@/lib/constants'
|
||||
import { LND_PATHFINDING_TIME_PREF_PPM, LND_PATHFINDING_TIMEOUT_MS, PAID_ACTION_TERMINAL_STATES } from '@/lib/constants'
|
||||
import { formatMsats, formatSats, msatsToSats, toPositiveNumber } from '@/lib/format'
|
||||
import { datePivot } from '@/lib/time'
|
||||
import { Prisma } from '@prisma/client'
|
||||
|
@ -270,6 +270,7 @@ export async function paidActionForwarding ({ data: { invoiceId, ...args }, mode
|
|||
request: bolt11,
|
||||
max_fee_mtokens: String(maxFeeMsats),
|
||||
pathfinding_timeout: LND_PATHFINDING_TIMEOUT_MS,
|
||||
confidence: LND_PATHFINDING_TIME_PREF_PPM,
|
||||
max_timeout_height: maxTimeoutHeight
|
||||
}).catch(console.error)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue