From bc164de7b6a4be62a9f93cc4106d03e9f1163ce7 Mon Sep 17 00:00:00 2001 From: fuwa Date: Thu, 27 Jun 2019 22:08:17 +0800 Subject: [PATCH] use minimumHeight in sync checking --- cyberwow/lib/controller/daemon.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cyberwow/lib/controller/daemon.dart b/cyberwow/lib/controller/daemon.dart index 2b46db4..f03066d 100644 --- a/cyberwow/lib/controller/daemon.dart +++ b/cyberwow/lib/controller/daemon.dart @@ -23,6 +23,7 @@ import 'dart:async'; import 'dart:convert'; import 'rpc.dart' as rpc; +import '../config.dart'; Future isConnected() async { final _outPeers = await rpc.outgoingConnectionsCount(); @@ -35,7 +36,7 @@ Future isConnected() async { Future isSynced() async { final _targetHeight = await rpc.targetHeight(); final _height = await rpc.height(); - return _targetHeight >= 0 && _targetHeight <= _height; + return _targetHeight >= 0 && _targetHeight <= _height && _height > minimumHeight; } Future isNotSynced() async {