From 874d725f40ae9239fb48a3867ed1ee4f88484f45 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 4 Oct 2016 05:26:22 -0700 Subject: [PATCH] wallet: minor. --- lib/wallet/walletdb.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/wallet/walletdb.js b/lib/wallet/walletdb.js index d1adc4fc..0f0274f1 100644 --- a/lib/wallet/walletdb.js +++ b/lib/wallet/walletdb.js @@ -143,11 +143,11 @@ function WalletDB(options) { this.network = Network.get(options.network); this.fees = options.fees; this.logger = options.logger || Logger.global; - this.wallets = {}; this.tip = this.network.genesis.hash; this.height = 0; this.depth = 0; + this.wallets = {}; // We need one read lock for `get` and `create`. // It will hold locks specific to wallet ids. @@ -232,6 +232,7 @@ WalletDB.prototype._close = co(function* close() { key = keys[i]; wallet = this.wallets[key]; yield wallet.destroy(); + delete this.wallets[key]; } yield this.db.close();