routing: add error var for pre-built route tried
This commit is contained in:
parent
ac2df9bbf4
commit
b5f1bde604
@ -1,7 +1,7 @@
|
|||||||
package routing
|
package routing
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"errors"
|
||||||
|
|
||||||
"github.com/lightningnetwork/lnd/channeldb"
|
"github.com/lightningnetwork/lnd/channeldb"
|
||||||
"github.com/lightningnetwork/lnd/lnwire"
|
"github.com/lightningnetwork/lnd/lnwire"
|
||||||
@ -12,6 +12,12 @@ import (
|
|||||||
// to prevent an HTLC being failed if some blocks are mined while it's in-flight.
|
// to prevent an HTLC being failed if some blocks are mined while it's in-flight.
|
||||||
const BlockPadding uint16 = 3
|
const BlockPadding uint16 = 3
|
||||||
|
|
||||||
|
var (
|
||||||
|
// errPrebuiltRouteTried is returned when the single pre-built route
|
||||||
|
// failed and there is nothing more we can do.
|
||||||
|
errPrebuiltRouteTried = errors.New("pre-built route already tried")
|
||||||
|
)
|
||||||
|
|
||||||
// PaymentSession is used during SendPayment attempts to provide routes to
|
// PaymentSession is used during SendPayment attempts to provide routes to
|
||||||
// attempt. It also defines methods to give the PaymentSession additional
|
// attempt. It also defines methods to give the PaymentSession additional
|
||||||
// information learned during the previous attempts.
|
// information learned during the previous attempts.
|
||||||
@ -66,7 +72,7 @@ func (p *paymentSession) RequestRoute(payment *LightningPayment,
|
|||||||
// If the pre-built route has been tried already, the payment session is
|
// If the pre-built route has been tried already, the payment session is
|
||||||
// over.
|
// over.
|
||||||
case p.preBuiltRoute != nil:
|
case p.preBuiltRoute != nil:
|
||||||
return nil, fmt.Errorf("pre-built route already tried")
|
return nil, errPrebuiltRouteTried
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add BlockPadding to the finalCltvDelta so that the receiving node
|
// Add BlockPadding to the finalCltvDelta so that the receiving node
|
||||||
|
Loading…
Reference in New Issue
Block a user