wallet: minor.
This commit is contained in:
parent
3599ab5d9a
commit
874d725f40
@ -143,11 +143,11 @@ function WalletDB(options) {
|
|||||||
this.network = Network.get(options.network);
|
this.network = Network.get(options.network);
|
||||||
this.fees = options.fees;
|
this.fees = options.fees;
|
||||||
this.logger = options.logger || Logger.global;
|
this.logger = options.logger || Logger.global;
|
||||||
this.wallets = {};
|
|
||||||
|
|
||||||
this.tip = this.network.genesis.hash;
|
this.tip = this.network.genesis.hash;
|
||||||
this.height = 0;
|
this.height = 0;
|
||||||
this.depth = 0;
|
this.depth = 0;
|
||||||
|
this.wallets = {};
|
||||||
|
|
||||||
// We need one read lock for `get` and `create`.
|
// We need one read lock for `get` and `create`.
|
||||||
// It will hold locks specific to wallet ids.
|
// It will hold locks specific to wallet ids.
|
||||||
@ -232,6 +232,7 @@ WalletDB.prototype._close = co(function* close() {
|
|||||||
key = keys[i];
|
key = keys[i];
|
||||||
wallet = this.wallets[key];
|
wallet = this.wallets[key];
|
||||||
yield wallet.destroy();
|
yield wallet.destroy();
|
||||||
|
delete this.wallets[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
yield this.db.close();
|
yield this.db.close();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user