commit e100cb3b7e87248a9d659701d51e63bc189f24a6
parent 478fc02820696bdbbf5af9e7ca9b1a6c4a6f954a
Author: chris-belcher <chris-belcher@users.noreply.github.com>
Date: Thu, 29 Mar 2018 18:19:14 +0100
extended features of last commit to the rescan script too
Diffstat:
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/rescan-script.py b/rescan-script.py
@@ -1,6 +1,6 @@
#! /usr/bin/python3
-from configparser import ConfigParser, NoSectionError
+from configparser import ConfigParser, NoSectionError, NoOptionError
from electrumpersonalserver.jsonrpc import JsonRpc, JsonRpcError
from datetime import datetime
import server
@@ -40,8 +40,12 @@ def main():
except NoSectionError:
print("Non-existant configuration file `config.cfg`")
return
- rpc_u, rpc_p = server.obtain_rpc_username_password(config.get(
- "bitcoin-rpc", "datadir"))
+ try:
+ rpc_u = config.get("bitcoin-rpc", "rpc_user")
+ rpc_p = config.get("bitcoin-rpc", "rpc_password")
+ except NoOptionError:
+ rpc_u, rpc_p = server.obtain_rpc_username_password(config.get(
+ "bitcoin-rpc", "datadir"))
if rpc_u == None:
return
rpc = JsonRpc(host = config.get("bitcoin-rpc", "host"),