locker. options.

This commit is contained in:
Christopher Jeffrey 2016-04-07 14:30:52 -07:00
parent 1898b38c49
commit d1d92b9b64
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
3 changed files with 7 additions and 6 deletions

View File

@ -63,6 +63,10 @@ Chain.prototype._init = function _init() {
return 'unknown';
}
this.locker.on('purge', function(total, size) {
bcoin.debug('Warning: %dmb of pending objects. Purging.', utils.mb(size));
});
// Hook into events for debugging
this.on('block', function(block, entry) {
if (self.height < 400000)

View File

@ -34,16 +34,14 @@ function ldb(options) {
cacheSize: options.cacheSize || (8 << 20),
writeBufferSize: options.writeBufferSize || (4 << 20),
maxOpenFiles: options.maxOpenFiles || 8192,
filterBits: 0,
paranoidChecks: false,
// For LMDB if we decide to use it:
sync: options.sync || false,
mapSize: options.mapSize || 150 * (1024 << 20),
writeMap: options.writeMap || false,
// For RocksDB
// optimizeCompaction: 'level',
// memtableBudget: 512 << 20,
db: getBackend(options.db)
});
}

View File

@ -104,8 +104,7 @@ Locker.prototype.purgePending = function purgePending() {
assert(this.add);
bcoin.debug('Warning: %dmb of pending objects. Purging.',
utils.mb(this.pendingSize));
this.emit('purge', total, this.pendingSize);
this.pending.forEach(function(obj) {
delete self.pendingMap[obj.hash('hex')];