catch wrap invoice error as noninvoiceable
This commit is contained in:
parent
67a0565c04
commit
09bacdc016
|
@ -198,6 +198,8 @@ async function performP2PAction (actionType, args, incomingContext) {
|
|||
throw new NonInvoiceablePeerError()
|
||||
}
|
||||
|
||||
let context
|
||||
try {
|
||||
await assertBelowMaxPendingInvoices(incomingContext)
|
||||
|
||||
const description = await paidActions[actionType].describe(args, incomingContext)
|
||||
|
@ -208,7 +210,7 @@ async function performP2PAction (actionType, args, incomingContext) {
|
|||
expiry: INVOICE_EXPIRE_SECS
|
||||
}, { models, me, lnd })
|
||||
|
||||
const context = {
|
||||
context = {
|
||||
...incomingContext,
|
||||
invoiceArgs: {
|
||||
bolt11: invoice,
|
||||
|
@ -217,6 +219,10 @@ async function performP2PAction (actionType, args, incomingContext) {
|
|||
maxFee
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('failed to create wrapped invoice', e)
|
||||
throw new NonInvoiceablePeerError()
|
||||
}
|
||||
|
||||
return me
|
||||
? await performOptimisticAction(actionType, args, context)
|
||||
|
|
Loading…
Reference in New Issue