network: remove batchSize.
This commit is contained in:
parent
d0e226f926
commit
db85d6db18
@ -53,7 +53,6 @@ function Network(options) {
|
||||
this.maxFeeRate = options.maxFeeRate;
|
||||
this.selfConnect = options.selfConnect;
|
||||
this.requestMempool = options.requestMempool;
|
||||
this.batchSize = options.batchSize;
|
||||
this.time = new TimeData();
|
||||
|
||||
this._init();
|
||||
@ -129,26 +128,6 @@ Network.prototype.byBit = function byBit(bit) {
|
||||
return this.deploys[index];
|
||||
};
|
||||
|
||||
/**
|
||||
* Determine how many blocks to request
|
||||
* based on current height of the chain.
|
||||
* @param {Number} height
|
||||
* @returns {Number}
|
||||
*/
|
||||
|
||||
Network.prototype.getBatchSize = function getBatchSize(height) {
|
||||
var batch = this.batchSize;
|
||||
var last = batch.length - 1;
|
||||
var i;
|
||||
|
||||
for (i = 0; i < last; i++) {
|
||||
if (height <= batch[i][0])
|
||||
return batch[i][1];
|
||||
}
|
||||
|
||||
return batch[last][0];
|
||||
};
|
||||
|
||||
/**
|
||||
* Get network adjusted time.
|
||||
* @returns {Number}
|
||||
|
||||
@ -459,19 +459,6 @@ main.selfConnect = false;
|
||||
|
||||
main.requestMempool = false;
|
||||
|
||||
/**
|
||||
* Number of blocks to request based on chain height.
|
||||
* @const {Array}
|
||||
*/
|
||||
|
||||
main.batchSize = [
|
||||
[100000, 500],
|
||||
[150000, 250],
|
||||
[250000, 150],
|
||||
[350000, 50],
|
||||
[20]
|
||||
];
|
||||
|
||||
/*
|
||||
* Testnet (v3)
|
||||
* https://en.bitcoin.it/wiki/Testnet
|
||||
@ -640,11 +627,6 @@ testnet.selfConnect = false;
|
||||
|
||||
testnet.requestMempool = false;
|
||||
|
||||
testnet.batchSize = [
|
||||
[100000, 500],
|
||||
[250]
|
||||
];
|
||||
|
||||
/*
|
||||
* Regtest
|
||||
*/
|
||||
@ -792,10 +774,6 @@ regtest.selfConnect = true;
|
||||
|
||||
regtest.requestMempool = true;
|
||||
|
||||
regtest.batchSize = [
|
||||
[500]
|
||||
];
|
||||
|
||||
/*
|
||||
* segnet4
|
||||
*/
|
||||
@ -937,11 +915,6 @@ segnet4.selfConnect = false;
|
||||
|
||||
segnet4.requestMempool = true;
|
||||
|
||||
segnet4.batchSize = [
|
||||
[17000, 500],
|
||||
[250]
|
||||
];
|
||||
|
||||
/*
|
||||
* Simnet (btcd)
|
||||
*/
|
||||
@ -1090,8 +1063,3 @@ simnet.maxFeeRate = 60000;
|
||||
simnet.selfConnect = true;
|
||||
|
||||
simnet.requestMempool = false;
|
||||
|
||||
simnet.batchSize = [
|
||||
[100000, 500],
|
||||
[250]
|
||||
];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user