From c5961d49042817c450aa9a531e13d6784bb96f30 Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Wed, 13 Feb 2019 11:21:10 +0100 Subject: [PATCH] routing: only warn for zero cltv delta edges This condition may be caused by a bug somewhere else in the system. Expose it here as a warn log line. --- routing/pathfind.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/routing/pathfind.go b/routing/pathfind.go index 8862c11e..45853ad6 100644 --- a/routing/pathfind.go +++ b/routing/pathfind.go @@ -606,14 +606,11 @@ func findPath(g *graphParams, r *RestrictParams, source, target Vertex, return } - // If the edge has no time lock delta, the payment will always - // fail, so return. - // - // TODO(joostjager): Is this really true? Can't it be that - // nodes take this risk in exchange for a extraordinary high - // fee? + // Every edge should have a positive time lock delta. If we + // encounter a zero delta, log a warning line. if edge.TimeLockDelta == 0 { - return + log.Warnf("Channel %v has zero cltv delta", + edge.ChannelID) } // All conditions are met and this new tentative distance is