Skip to content

Commit a388811

Browse files
author
gitopia1gyrcgtfa8lqmytl5svv3y8s439l7xhccgh8q4p
committed
Merge pull request #23 from git-remote-gitopia/check-sync-status
2 parents efa4a0b + a38c6fe commit a388811

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ All notable changes will be documented here.
66

77
- fix offchain proto warning
88
- remove websocket connection with rpc servers
9+
- check sync status in rpc provider liveness test
910

1011
## [v1.9.0] - 2024-08-20
1112

core/api/grpc.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,16 @@ func CheckGRPCHostLiveness(host string) bool {
1818
defer conn.Close()
1919

2020
client := tmservice.NewServiceClient(conn)
21-
_, err = client.GetNodeInfo(context.Background(), &tmservice.GetNodeInfoRequest{})
22-
return err == nil
21+
res, err := client.GetSyncing(context.Background(), &tmservice.GetSyncingRequest{})
22+
if err != nil {
23+
return false
24+
}
25+
26+
if res.Syncing {
27+
return false
28+
}
29+
30+
return true
2331
}
2432

2533
func checkGRPCHostLatency(host string) time.Duration {

0 commit comments

Comments
 (0)