rpc: expose graph synced status within GetInfo
This commit is contained in:
4 files changed
+515
-494
No files matched your search
+504
-494
File diff suppressed because it is too large.
Load diff
@@ -1343,6 +1343,9 @@ message GetInfoResponse {
|
|||||||
|
|
||||||
/// The color of the current node in hex code format
|
/// The color of the current node in hex code format
|
||||||
string color = 17 [json_name = "color"];
|
string color = 17 [json_name = "color"];
|
||||||
|
|
||||||
|
// Whether we consider ourselves synced with the public channel graph.
|
||||||
|
bool synced_to_graph = 18 [json_name = "synced_to_graph"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message Chain {
|
message Chain {
|
||||||
|
|||||||
@@ -2218,6 +2218,11 @@
|
|||||||
"color": {
|
"color": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"title": "/ The color of the current node in hex code format"
|
"title": "/ The color of the current node in hex code format"
|
||||||
|
},
|
||||||
|
"synced_to_graph": {
|
||||||
|
"type": "boolean",
|
||||||
|
"format": "boolean",
|
||||||
|
"description": "Whether we consider ourselves synced with the public channel graph."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2029,6 +2029,8 @@ func (r *rpcServer) GetInfo(ctx context.Context,
|
|||||||
uris[i] = fmt.Sprintf("%s@%s", encodedIDPub, addr.String())
|
uris[i] = fmt.Sprintf("%s@%s", encodedIDPub, addr.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isGraphSynced := r.server.authGossiper.SyncManager().IsGraphSynced()
|
||||||
|
|
||||||
// TODO(roasbeef): add synced height n stuff
|
// TODO(roasbeef): add synced height n stuff
|
||||||
return &lnrpc.GetInfoResponse{
|
return &lnrpc.GetInfoResponse{
|
||||||
IdentityPubkey: encodedIDPub,
|
IdentityPubkey: encodedIDPub,
|
||||||
@@ -2046,6 +2048,7 @@ func (r *rpcServer) GetInfo(ctx context.Context,
|
|||||||
Color: routing.EncodeHexColor(nodeAnn.RGBColor),
|
Color: routing.EncodeHexColor(nodeAnn.RGBColor),
|
||||||
BestHeaderTimestamp: int64(bestHeaderTimestamp),
|
BestHeaderTimestamp: int64(bestHeaderTimestamp),
|
||||||
Version: build.Version(),
|
Version: build.Version(),
|
||||||
|
SyncedToGraph: isGraphSynced,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user