mirror of
https://github.com/aljazceru/python-teos.git
synced 2026-02-23 15:34:18 +01:00
Moves db_manager instantiation before checking the connection with bitcoin
As it was until now, if the connection with bitcoind failed, the command would have also failed, since the db_manager was not yet defined.
This commit is contained in:
@@ -84,6 +84,7 @@ if __name__ == "__main__":
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
pisa_config = load_config(conf)
|
pisa_config = load_config(conf)
|
||||||
|
db_manager = DBManager(pisa_config.get("DB_PATH"))
|
||||||
|
|
||||||
if not can_connect_to_bitcoind():
|
if not can_connect_to_bitcoind():
|
||||||
logger.error("Can't connect to bitcoind. Shutting down")
|
logger.error("Can't connect to bitcoind. Shutting down")
|
||||||
@@ -93,8 +94,6 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
db_manager = DBManager(pisa_config.get("DB_PATH"))
|
|
||||||
|
|
||||||
# Create the chain monitor and start monitoring the chain
|
# Create the chain monitor and start monitoring the chain
|
||||||
chain_monitor = ChainMonitor()
|
chain_monitor = ChainMonitor()
|
||||||
chain_monitor.monitor_chain()
|
chain_monitor.monitor_chain()
|
||||||
|
|||||||
Reference in New Issue
Block a user