-
Notifications
You must be signed in to change notification settings - Fork 216
Ensure failed payments marked as failed #3145
Conversation
d87618e
to
6c79a0f
Compare
6c79a0f
to
a0488d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of minor comments
grpcLog.error('PAYMENT ERROR', res) | ||
const error = new Error(res.payment_error) | ||
error.details = res | ||
reject(error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why here we reject and in catch
we re-throw?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rejection here is used to reject the Promise within the data
event handler in the case that the sendPayment
lightning call returns an error (which it does by returning a success but with payment_error
set).
The catch at the end wraps the entire method and is triggered in the event that an unexpected error occurs anywhere within our sendPayment
wrapper. It doesn't re throw the rejection from the data
event handler.
Generate a unique payment id for sending payments to enable more accurate tracking of payments across retry attempts. Fix LN-Zap#3142
e55c00f
to
f1600d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested ACK f1600d1
Description:
Ensure failed payments marked as failed
Generate a unique payment id for sending payments to enable more accurate tracking of payments across retry attempts.
Motivation and Context:
Fix #3142
How Has This Been Tested?
Manually
Types of changes:
Fix
Checklist: