fix wallet server shutdown for tests

This commit is contained in:
Victor Shyba 2018-11-07 16:54:27 -03:00 committed by Lex Berezhny
parent b8a3b62f0f
commit fb6a7442a6
2 changed files with 5 additions and 1 deletions

View file

@ -175,7 +175,7 @@ class SPVNode:
async def stop(self, cleanup=True):
try:
await self.controller.shutdown()
self.server.db.shutdown()
finally:
cleanup and self.cleanup()

View file

@ -133,6 +133,10 @@ class DB(object):
# Read TX counts (requires meta directory)
await self._read_tx_counts()
def shutdown(self):
self.utxo_db.close()
self.history.close_db()
async def open_for_compacting(self):
await self._open_dbs(True, True)