Skip to content

Commit

Permalink
rpcserver: correctly compute edge-level lastUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
cfromknecht authored and matheusd committed Aug 30, 2019
1 parent 0fd4c40 commit 8cdc900
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8cdc900

Please sign in to comment.