routing/pathfind: ensure final hop supports payment addrs

This commit adds an optional PaymentAddr field to the RestrictParams, so
that we can verify the final hop can support it before doing an
expensive round of pathfindig.
This commit is contained in:
Conner Fromknecht
2019-12-18 23:54:31 -08:00
parent acb7b83ead
commit 990d55d08c
3 changed files with 88 additions and 1 deletions

View File

@ -192,7 +192,11 @@ func (p *paymentLifecycle) resumePayment() ([32]byte, *route.Route, error) {
// payment-level failure.
func errorToPaymentFailure(err error) channeldb.FailureReason {
switch err {
case errNoTlvPayload, errNoPathFound, errMaxHopsExceeded,
case
errNoTlvPayload,
errNoPaymentAddr,
errNoPathFound,
errMaxHopsExceeded,
errPrebuiltRouteTried:
return channeldb.FailureReasonNoRoute