mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-17 22:24:23 +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
|
||||
|
||||
pisa_config = load_config(conf)
|
||||
db_manager = DBManager(pisa_config.get("DB_PATH"))
|
||||
|
||||
if not can_connect_to_bitcoind():
|
||||
logger.error("Can't connect to bitcoind. Shutting down")
|
||||
@@ -93,8 +94,6 @@ if __name__ == "__main__":
|
||||
|
||||
else:
|
||||
try:
|
||||
db_manager = DBManager(pisa_config.get("DB_PATH"))
|
||||
|
||||
# Create the chain monitor and start monitoring the chain
|
||||
chain_monitor = ChainMonitor()
|
||||
chain_monitor.monitor_chain()
|
||||
|
||||
Reference in New Issue
Block a user