From 132080d564b3a9576fd6cf35295a712169369912 Mon Sep 17 00:00:00 2001 From: jseagrave21 Date: Mon, 23 Sep 2019 23:32:46 -0700 Subject: [PATCH] update per https://github.com/CityOfZion/neo-python/issues/1020#issuecomment-533987238 - restore warning in case privatenet database is different from the one you're connecting to (e.g. because you restarted your docker image or single node) --- neo/bin/api_server.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/neo/bin/api_server.py b/neo/bin/api_server.py index 0b58342d8..6c5af63f3 100755 --- a/neo/bin/api_server.py +++ b/neo/bin/api_server.py @@ -44,7 +44,7 @@ from neo.Wallets.utils import to_aes_key from neo.Implementations.Wallets.peewee.UserWallet import UserWallet from neo.Network.p2pservice import NetworkService -from neo.Settings import settings +from neo.Settings import settings, PrivnetConnectionError from neo.Utils.plugin import load_class_from_path from neo.Wallets.utils import to_aes_key from contextlib import suppress @@ -152,7 +152,11 @@ async def setup_and_start(loop): elif args.testnet: settings.setup_testnet() elif args.privnet: - settings.setup_privnet() + try: + settings.setup_privnet() + except PrivnetConnectionError as e: + print(e) + raise SystemExit elif args.coznet: settings.setup_coznet()