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 committed 2019-12-18 23:54:31 -08:00
1 parent acb7b83ead
commit 990d55d08c
3 files changed
+88 -1

No files matched your search

+5 -1
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