fix tests. non-rolling bloom filter for txdb.
This commit is contained in:
parent
aec1ebbdd3
commit
48855ae56f
@ -62,8 +62,15 @@ function TXDB(db, options) {
|
||||
this.busy = false;
|
||||
this.jobs = [];
|
||||
this.locker = new bcoin.locker(this);
|
||||
|
||||
// Try to optimize for up to 1m addresses.
|
||||
// We use a regular bloom filter here
|
||||
// because we never want members to
|
||||
// lose membership, even if quality
|
||||
// degrades.
|
||||
// Memory used: 1.7mb
|
||||
this.filter = this.options.useFilter
|
||||
? new bcoin.bloom.rolling(800000, 0.01)
|
||||
? bcoin.bloom.fromRate(1000000, 0.001, -1)
|
||||
: null;
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ var network = bcoin.network.get();
|
||||
var utils = bcoin.utils;
|
||||
var fs = require('fs');
|
||||
var alertData = fs.readFileSync(__dirname + '/data/alertTests.raw');
|
||||
var NetworkAddress = bcoin.packets.NetworkAddress;
|
||||
|
||||
describe('Protocol', function() {
|
||||
var version = require('../package.json').version;
|
||||
@ -35,8 +36,8 @@ describe('Protocol', function() {
|
||||
version: constants.VERSION,
|
||||
services: constants.LOCAL_SERVICES,
|
||||
ts: bcoin.now(),
|
||||
remote: new bcoin.networkaddress(),
|
||||
local: new bcoin.networkaddress(),
|
||||
remote: new NetworkAddress(),
|
||||
local: new NetworkAddress(),
|
||||
nonce: utils.nonce(),
|
||||
agent: constants.USER_AGENT,
|
||||
height: 0,
|
||||
@ -54,8 +55,8 @@ describe('Protocol', function() {
|
||||
version: constants.VERSION,
|
||||
services: constants.LOCAL_SERVICES,
|
||||
ts: bcoin.now(),
|
||||
remote: new bcoin.networkaddress(),
|
||||
local: new bcoin.networkaddress(),
|
||||
remote: new NetworkAddress(),
|
||||
local: new NetworkAddress(),
|
||||
nonce: utils.nonce(),
|
||||
agent: constants.USER_AGENT,
|
||||
height: 10,
|
||||
@ -73,13 +74,13 @@ describe('Protocol', function() {
|
||||
});
|
||||
|
||||
var hosts = [
|
||||
new bcoin.networkaddress({
|
||||
new NetworkAddress({
|
||||
services: constants.LOCAL_SERVICES,
|
||||
host: '127.0.0.1',
|
||||
port: 8333,
|
||||
ts: Date.now() / 1000 | 0
|
||||
}),
|
||||
new bcoin.networkaddress({
|
||||
new NetworkAddress({
|
||||
services: constants.LOCAL_SERVICES,
|
||||
host: '::123:456:789a',
|
||||
port: 18333,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user