comments. cleanup.
This commit is contained in:
parent
5a56412d51
commit
1e1bd82355
@ -48,7 +48,7 @@ function runBench(callback) {
|
||||
},
|
||||
function(next) {
|
||||
var end = bench('accounts');
|
||||
utils.forRange(0, 5000, function(i, next) {
|
||||
utils.forRange(0, 1000, function(i, next) {
|
||||
wallet.createAccount({}, function(err, account) {
|
||||
assert.ifError(err);
|
||||
addrs.push(account.receiveAddress.getAddress());
|
||||
|
||||
@ -54,8 +54,9 @@ function WalletDB(options) {
|
||||
// We need one read lock for `get` and `create`.
|
||||
// It will hold locks specific to wallet ids.
|
||||
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.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) {
|
||||
var self = this;
|
||||
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) {
|
||||
var self = this;
|
||||
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) {
|
||||
var self = this;
|
||||
var paths;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user