refactor: rename constructors.
This commit is contained in:
parent
76a32feb5d
commit
6dfa47e7f4
@ -196,7 +196,7 @@ function ChainDB(chain) {
|
||||
// We want to keep the last 5 blocks of unspents in memory.
|
||||
this.coinWindow = 25 << 20;
|
||||
|
||||
this.coinCache = new LRU.nil();
|
||||
this.coinCache = new LRU.Nil();
|
||||
this.cacheHash = new LRU(this.cacheWindow);
|
||||
this.cacheHeight = new LRU(this.cacheWindow);
|
||||
|
||||
|
||||
@ -91,7 +91,7 @@ function Mempool(options) {
|
||||
this.coinIndex = new AddressIndex(this);
|
||||
this.txIndex = new AddressIndex(this);
|
||||
|
||||
this.rejects = new Bloom.rolling(120000, 0.000001);
|
||||
this.rejects = new Bloom.Rolling(120000, 0.000001);
|
||||
|
||||
this.freeCount = 0;
|
||||
this.lastTime = 0;
|
||||
|
||||
@ -99,8 +99,8 @@ function Peer(pool, addr, socket) {
|
||||
this.spvFilter = null;
|
||||
this.relay = true;
|
||||
this.feeRate = -1;
|
||||
this.addrFilter = new Bloom.rolling(5000, 0.001);
|
||||
this.invFilter = new Bloom.rolling(50000, 0.000001);
|
||||
this.addrFilter = new Bloom.Rolling(5000, 0.001);
|
||||
this.invFilter = new Bloom.Rolling(50000, 0.000001);
|
||||
this.lastBlock = null;
|
||||
this.waiting = 0;
|
||||
this.syncSent = false;
|
||||
|
||||
@ -233,7 +233,7 @@ Pool.prototype._initOptions = function _initOptions() {
|
||||
this.spvFilter = Bloom.fromRate(10000, 0.001, constants.bloom.NONE);
|
||||
|
||||
if (!this.options.mempool)
|
||||
this.txFilter = new Bloom.rolling(50000, 0.000001);
|
||||
this.txFilter = new Bloom.Rolling(50000, 0.000001);
|
||||
|
||||
if (this.options.requestTimeout != null)
|
||||
this.requestTimeout = this.options.requestTimeout;
|
||||
|
||||
@ -374,6 +374,6 @@ function write(data, value, off) {
|
||||
|
||||
exports = Bloom;
|
||||
exports.murmur3 = murmur3;
|
||||
exports.rolling = RollingFilter;
|
||||
exports.Rolling = RollingFilter;
|
||||
|
||||
module.exports = exports;
|
||||
|
||||
@ -265,6 +265,6 @@ MappedLock.prototype.destroy = function destroy() {
|
||||
*/
|
||||
|
||||
exports = Locker;
|
||||
exports.mapped = MappedLock;
|
||||
exports.Mapped = MappedLock;
|
||||
|
||||
module.exports = exports;
|
||||
|
||||
@ -361,6 +361,6 @@ NullCache.prototype.toArray = function toArray(key) { return []; };
|
||||
* Expose
|
||||
*/
|
||||
|
||||
LRU.nil = NullCache;
|
||||
LRU.Nil = NullCache;
|
||||
|
||||
module.exports = LRU;
|
||||
|
||||
@ -152,7 +152,7 @@ function WalletDB(options) {
|
||||
|
||||
// We need one read lock for `get` and `create`.
|
||||
// It will hold locks specific to wallet ids.
|
||||
this.readLock = new Locker.mapped();
|
||||
this.readLock = new Locker.Mapped();
|
||||
this.writeLock = new Locker();
|
||||
this.txLock = new Locker();
|
||||
|
||||
|
||||
@ -89,7 +89,7 @@ describe('Bloom', function() {
|
||||
});
|
||||
|
||||
it('should handle 1m ops with rolling filter', function() {
|
||||
var filter = new bcoin.bloom.rolling(210000, 0.00001);
|
||||
var filter = new bcoin.bloom.Rolling(210000, 0.00001);
|
||||
filter.tweak = 0xdeadbeef;
|
||||
// ~1m operations
|
||||
for (var i = 0; i < 1000; i++) {
|
||||
@ -105,7 +105,7 @@ describe('Bloom', function() {
|
||||
});
|
||||
|
||||
it('should handle rolling generations', function() {
|
||||
var filter = new bcoin.bloom.rolling(50, 0.00001);
|
||||
var filter = new bcoin.bloom.Rolling(50, 0.00001);
|
||||
filter.tweak = 0xdeadbeee;
|
||||
for (var i = 0; i < 25; i++) {
|
||||
var str = 'foobar' + i;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user