rpcserver: marshal db edges by increasing pubkey

This commit is contained in:
Conner Fromknecht 2019-08-28 13:30:06 -07:00
parent 64c7a0faa8
commit 2ebd76bbbb
No known key found for this signature in database
GPG Key ID: E7D737B67FA592C7

View File

@ -3770,6 +3770,13 @@ func (r *rpcServer) DescribeGraph(ctx context.Context,
func marshalDbEdge(edgeInfo *channeldb.ChannelEdgeInfo,
c1, c2 *channeldb.ChannelEdgePolicy) *lnrpc.ChannelEdge {
// Order the edges by increasing pubkey.
if bytes.Compare(edgeInfo.NodeKey2Bytes[:],
edgeInfo.NodeKey1Bytes[:]) < 0 {
c2, c1 = c1, c2
}
var (
lastUpdate int64
)