routing: prune vertex, not ege after repeated FeeInsufficientErrors

In this commit, we modify the way we handle FeeInsufficientErrors to
more aggressively route around nodes that repeatedly return the same
error to us. This will ensure we skip older nodes on the network which
are running a buggier older version of lnd. Eventually most nodes will
upgrade to this new version, making this change less needed.

We also update the existing test to properly use a multi-hop route to
ensure that we route around the offending node.
This commit is contained in:
Olaoluwa Osuntokun
2018-04-05 18:01:40 -07:00
parent aa7f83d72e
commit a6ffe999c6
2 changed files with 15 additions and 18 deletions

View File

@@ -1724,12 +1724,12 @@ func (r *ChannelRouter) SendPayment(payment *LightningPayment) ([32]byte, *Route
// We'll now check to see if we've already
// reported a fee related failure for this
// node. If so, then we'll actually prune out
// the edge for now.
// the vertex for now.
chanID := update.ShortChannelID
_, ok := errFailedFeeChans[chanID]
if ok {
pruneEdgeFailure(
paySession, route, errSource,
pruneVertexFailure(
paySession, route, errSource, false,
)
continue
}