mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-31 17:51:33 +02:00
routing: penalize node-level failures harder
Previously we only penalized the outgoing connections of a failing node. This turned out not to be sufficient, because the next route sometimes went into the same failing node again to try a different outgoing connection that wasn't yet known to mission control and therefore not penalized before.
This commit is contained in:
@@ -333,18 +333,18 @@ func (m *MissionControl) setLastPairResult(fromNode, toNode route.Vertex,
|
||||
nodePairs[toNode] = current
|
||||
}
|
||||
|
||||
// setAllFail stores a fail result for all known connection of the given node.
|
||||
func (m *MissionControl) setAllFail(fromNode route.Vertex,
|
||||
// setAllFail stores a fail result for all known connections to and from the
|
||||
// given node.
|
||||
func (m *MissionControl) setAllFail(node route.Vertex,
|
||||
timestamp time.Time) {
|
||||
|
||||
nodePairs, ok := m.lastPairResult[fromNode]
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
for connection := range nodePairs {
|
||||
nodePairs[connection] = TimedPairResult{
|
||||
FailTime: timestamp,
|
||||
for fromNode, nodePairs := range m.lastPairResult {
|
||||
for toNode := range nodePairs {
|
||||
if fromNode == node || toNode == node {
|
||||
nodePairs[toNode] = TimedPairResult{
|
||||
FailTime: timestamp,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user