track sync_head on header_sync sync status (#3626)

* track sync_head on header_sync sync status
follow header fork as appropriate

* track highest_diff alongside highest_height on HeaderSync status

* cleanup

* not not
This commit is contained in:
Antioch Peverell
2021-04-06 11:16:20 +01:00
committed by GitHub
parent df91bff0f1
commit 34413c1cab
10 changed files with 195 additions and 136 deletions
+3 -2
View File
@@ -79,11 +79,12 @@ fn sync_status_to_api(sync_status: SyncStatus) -> (String, Option<serde_json::Va
SyncStatus::NoSync => ("no_sync".to_string(), None),
SyncStatus::AwaitingPeers(_) => ("awaiting_peers".to_string(), None),
SyncStatus::HeaderSync {
current_height,
sync_head,
highest_height,
..
} => (
"header_sync".to_string(),
Some(json!({ "current_height": current_height, "highest_height": highest_height })),
Some(json!({ "current_height": sync_head.height, "highest_height": highest_height })),
),
SyncStatus::TxHashsetDownload(stats) => (
"txhashset_download".to_string(),