rpcserver+router: log terminal sendPayment error

This commit is contained in:
Johan T. Halseth 2019-06-21 09:32:51 +02:00 committed by Olaoluwa Osuntokun
parent 108f25dc89
commit 8b83f03308
No known key found for this signature in database
GPG Key ID: CE58F7F8E20FD9A2
2 changed files with 5 additions and 0 deletions

@ -218,6 +218,9 @@ func (p *paymentLifecycle) createNewPaymentAttempt() (lnwire.ShortChannelID,
p.payment, uint32(p.currentHeight), p.finalCLTVDelta,
)
if err != nil {
log.Warnf("Failed to find route for payment %x: %v",
p.payment.PaymentHash, err)
// If we're unable to successfully make a payment using
// any of the routes we've found, then mark the payment
// as permanently failed.

@ -3127,6 +3127,8 @@ func (r *rpcServer) dispatchPaymentIntent(
// If the route failed, then we'll return a nil save err, but a non-nil
// routing err.
if routerErr != nil {
rpcsLog.Warnf("Unable to send payment: %v", routerErr)
return &paymentIntentResponse{
Err: routerErr,
}, nil