From e099dbc72ec8e0cbf52ea426fb51b6170803a51a Mon Sep 17 00:00:00 2001 From: fuwa Date: Tue, 25 Jun 2019 17:37:00 +0800 Subject: [PATCH] fix an edge case of incorrect target_height in early syncing --- cyberwow/lib/config.dart | 1 + cyberwow/lib/state.dart | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cyberwow/lib/config.dart b/cyberwow/lib/config.dart index 155bb85..d8cd174 100644 --- a/cyberwow/lib/config.dart +++ b/cyberwow/lib/config.dart @@ -26,3 +26,4 @@ const config = cryptoConfig.config; const arch = 'arm64'; // const arch = 'x86_64'; +const minimumHeight = 10000; diff --git a/cyberwow/lib/state.dart b/cyberwow/lib/state.dart index 7efe19f..55e4630 100644 --- a/cyberwow/lib/state.dart +++ b/cyberwow/lib/state.dart @@ -147,8 +147,9 @@ class SyncingState extends HookedState { print(line); final _targetHeight = await rpc.targetHeight(); + final _height = await rpc.height(); - if (_targetHeight == 0) break; + if (_targetHeight == 0 && _height > minimumHeight) break; }