comments. cleanup.
This commit is contained in:
parent
5a56412d51
commit
1e1bd82355
@ -48,7 +48,7 @@ function runBench(callback) {
|
|||||||
},
|
},
|
||||||
function(next) {
|
function(next) {
|
||||||
var end = bench('accounts');
|
var end = bench('accounts');
|
||||||
utils.forRange(0, 5000, function(i, next) {
|
utils.forRange(0, 1000, function(i, next) {
|
||||||
wallet.createAccount({}, function(err, account) {
|
wallet.createAccount({}, function(err, account) {
|
||||||
assert.ifError(err);
|
assert.ifError(err);
|
||||||
addrs.push(account.receiveAddress.getAddress());
|
addrs.push(account.receiveAddress.getAddress());
|
||||||
|
|||||||
@ -54,8 +54,9 @@ function WalletDB(options) {
|
|||||||
// 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.
|
||||||
this.readLock = new ReadLock(this);
|
this.readLock = new ReadLock(this);
|
||||||
this.accountCache = new bcoin.lru(100000, 1);
|
|
||||||
this.walletCache = new bcoin.lru(100000, 1);
|
this.accountCache = new bcoin.lru(10000, 1);
|
||||||
|
this.walletCache = new bcoin.lru(10000, 1);
|
||||||
this.pathCache = new bcoin.lru(100000, 1);
|
this.pathCache = new bcoin.lru(100000, 1);
|
||||||
|
|
||||||
this.db = bcoin.ldb({
|
this.db = bcoin.ldb({
|
||||||
@ -450,6 +451,13 @@ WalletDB.prototype.get = function get(id, callback) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a wallet from the database, do not setup watcher.
|
||||||
|
* @private
|
||||||
|
* @param {WalletID} id
|
||||||
|
* @param {Function} callback - Returns [Error, {@link Wallet}].
|
||||||
|
*/
|
||||||
|
|
||||||
WalletDB.prototype._get = function get(id, callback) {
|
WalletDB.prototype._get = function get(id, callback) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var wallet;
|
var wallet;
|
||||||
@ -655,6 +663,14 @@ WalletDB.prototype.getAccount = function getAccount(id, name, callback) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get an account from the database. Do not setup watcher.
|
||||||
|
* @private
|
||||||
|
* @param {WalletID} id
|
||||||
|
* @param {Number} index - Account index.
|
||||||
|
* @param {Function} callback - Returns [Error, {@link Wallet}].
|
||||||
|
*/
|
||||||
|
|
||||||
WalletDB.prototype._getAccount = function getAccount(id, index, callback) {
|
WalletDB.prototype._getAccount = function getAccount(id, index, callback) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var key = id + '/' + index;
|
var key = id + '/' + index;
|
||||||
@ -894,6 +910,12 @@ WalletDB.prototype.saveAddress = function saveAddress(id, addresses, callback) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve paths by hash.
|
||||||
|
* @param {Hash} hash
|
||||||
|
* @param {Function} callback
|
||||||
|
*/
|
||||||
|
|
||||||
WalletDB.prototype._getPaths = function _getPaths(hash, callback) {
|
WalletDB.prototype._getPaths = function _getPaths(hash, callback) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var paths;
|
var paths;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user