Skip to content

Commit 62fbda4

Browse files
committed
improve indexer_status method
1 parent 5ce2b93 commit 62fbda4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node_interface.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ impl NodeInterface {
318318
let full_height = res_json["fullHeight"].as_u64().ok_or(NodeError::FailedParsingNodeResponse(res_json.to_string()))?;
319319
let indexed_height = res_json["indexedHeight"].as_u64().ok_or(NodeError::FailedParsingNodeResponse(res_json.to_string()))?;
320320

321-
let is_sync = (full_height as i64 - indexed_height as i64).abs() < 10;
321+
let is_sync = full_height.abs_diff(indexed_height) < 10;
322322
Ok(IndexerStatus {
323323
is_active: true,
324324
is_sync,

0 commit comments

Comments
 (0)