rpcserver: correctly compute edge-level lastUpdate
This commit is contained in:
1 file changed
+4
-7
+4
-7
@@ -3777,16 +3777,13 @@ func marshalDbEdge(edgeInfo *channeldb.ChannelEdgeInfo,
|
|||||||
c2, c1 = c1, c2
|
c2, c1 = c1, c2
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var lastUpdate int64
|
||||||
lastUpdate int64
|
|
||||||
)
|
|
||||||
|
|
||||||
if c2 != nil {
|
|
||||||
lastUpdate = c2.LastUpdate.Unix()
|
|
||||||
}
|
|
||||||
if c1 != nil {
|
if c1 != nil {
|
||||||
lastUpdate = c1.LastUpdate.Unix()
|
lastUpdate = c1.LastUpdate.Unix()
|
||||||
}
|
}
|
||||||
|
if c2 != nil && c2.LastUpdate.Unix() > lastUpdate {
|
||||||
|
lastUpdate = c2.LastUpdate.Unix()
|
||||||
|
}
|
||||||
|
|
||||||
edge := &lnrpc.ChannelEdge{
|
edge := &lnrpc.ChannelEdge{
|
||||||
ChannelId: edgeInfo.ChannelID,
|
ChannelId: edgeInfo.ChannelID,
|
||||||
|
|||||||
Reference in new issue
Block a user