fix send payment
This commit is contained in:
parent
de08e08d98
commit
03430e33ff
1 changed files with 7 additions and 5 deletions
|
|
@ -1459,7 +1459,8 @@ module.exports = async (
|
||||||
},
|
},
|
||||||
payment_hash: r_hash,
|
payment_hash: r_hash,
|
||||||
max_parts: maxParts,
|
max_parts: maxParts,
|
||||||
timeout_seconds: timeoutSeconds
|
timeout_seconds: timeoutSeconds,
|
||||||
|
no_inflight_updates: true
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const { payreq } = req.body
|
const { payreq } = req.body
|
||||||
|
|
@ -1467,7 +1468,8 @@ module.exports = async (
|
||||||
paymentRequest = {
|
paymentRequest = {
|
||||||
payment_request: payreq,
|
payment_request: payreq,
|
||||||
max_parts: maxParts,
|
max_parts: maxParts,
|
||||||
timeout_seconds: timeoutSeconds
|
timeout_seconds: timeoutSeconds,
|
||||||
|
no_inflight_updates: true
|
||||||
}
|
}
|
||||||
|
|
||||||
if (req.body.amt) {
|
if (req.body.amt) {
|
||||||
|
|
@ -1481,17 +1483,17 @@ module.exports = async (
|
||||||
sentPayment.on('data', response => {
|
sentPayment.on('data', response => {
|
||||||
if (res.headersSent) {
|
if (res.headersSent) {
|
||||||
//if res was already sent
|
//if res was already sent
|
||||||
if (response.failure_reason !== 'FAILURE_REASON_NONE') {
|
if (response.status !== 'SUCCEEDED') {
|
||||||
//if the operation failed
|
//if the operation failed
|
||||||
finalEvent = { error: response.failure_reason }
|
finalEvent = { error: response.failure_reason }
|
||||||
} else {
|
} else {
|
||||||
finalEvent = { status: response.status }
|
finalEvent = { status: response.status }
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (response.failure_reason !== 'FAILURE_REASON_NONE') {
|
if (response.status !== 'SUCCEEDED') {
|
||||||
logger.error('SendPayment Info:', response)
|
logger.error('SendPayment Info:', response)
|
||||||
return res.status(500).json({
|
return res.status(500).json({
|
||||||
errorMessage: response.failure_reason
|
errorMessage: sanitizeLNDError(response.details)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
logger.info('SendPayment Data:', response)
|
logger.info('SendPayment Data:', response)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue