From c58a1c9eadb37200e27819629922c07b01858d3c Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Tue, 26 Jun 2018 20:41:03 -0400 Subject: [PATCH] BaseLedger.stop() should also close the db --- tests/integration/test_transactions.py | 1 - torba/baseledger.py | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_transactions.py b/tests/integration/test_transactions.py index 2e2818dd0..3f7cb73c3 100644 --- a/tests/integration/test_transactions.py +++ b/tests/integration/test_transactions.py @@ -1,4 +1,3 @@ -import asyncio from orchstr8.testcase import IntegrationTestCase, d2f from torba.constants import COIN diff --git a/torba/baseledger.py b/torba/baseledger.py index 2ff360b9e..d7ea7d671 100644 --- a/torba/baseledger.py +++ b/torba/baseledger.py @@ -193,8 +193,10 @@ class BaseLedger(six.with_metaclass(LedgerRegistry)): yield self.network.subscribe_headers() yield self.update_accounts() + @defer.inlineCallbacks def stop(self): - return self.network.stop() + yield self.network.stop() + yield self.db.stop() @execute_serially @defer.inlineCallbacks