routing: account for case where final destination send TemporaryChannelFailure
In this commit, we fix an existing bug that could cause lnd to crash if we sent a payment, and the *destination* sent a temp channel failure error message. When handling such a message, we’ll look in the nextHop map to see which channel was *after* the node that sent the payment. However, if the destination sends this error, then there’ll be no entry in this map. To address this case, we now add a prevHop map. If we attempt to lookup a node in the nextHop map, and they don’t have an entry, then we’ll consult the prevHop map. We also update the set of tests to ensure that we’re properly setting both the prevHop map and the nextHop map.
This commit is contained in:
4 files changed
+78
-5
No files matched your search
@@ -222,6 +222,10 @@ func (p *paymentSession) RequestRoute(payment *LightningPayment,
|
||||
// shrinking.
|
||||
pruneView := p.pruneViewSnapshot
|
||||
|
||||
log.Debugf("Mission Control session using prune view of %v "+
|
||||
"edges, %v vertexes", len(pruneView.edges),
|
||||
len(pruneView.vertexes))
|
||||
|
||||
// TODO(roasbeef): sync logic amongst dist sys
|
||||
|
||||
// Taking into account this prune view, we'll attempt to locate a path
|
||||
|
||||
Reference in new issue
Block a user