From 8cdc900816ad54032d932dc395cb0f1614017600 Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Wed, 28 Aug 2019 13:31:12 -0700 Subject: [PATCH] rpcserver: correctly compute edge-level lastUpdate --- rpcserver.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/rpcserver.go b/rpcserver.go index a373499623..ca10d3f79d 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -3988,16 +3988,13 @@ func marshalDbEdge(edgeInfo *channeldb.ChannelEdgeInfo, c2, c1 = c1, c2 } - var ( - lastUpdate int64 - ) - - if c2 != nil { - lastUpdate = c2.LastUpdate.Unix() - } + var lastUpdate int64 if c1 != nil { lastUpdate = c1.LastUpdate.Unix() } + if c2 != nil && c2.LastUpdate.Unix() > lastUpdate { + lastUpdate = c2.LastUpdate.Unix() + } edge := &lnrpc.ChannelEdge{ ChannelId: edgeInfo.ChannelID,