network: add maxFeeRate for fee estimation.
This commit is contained in:
parent
60c64a6eba
commit
cf5349cdaa
@ -697,6 +697,9 @@ PolicyEstimator.prototype.estimateFee = function estimateFee(target, smart) {
|
|||||||
if (rate < this.network.feeRate)
|
if (rate < this.network.feeRate)
|
||||||
return this.network.feeRate;
|
return this.network.feeRate;
|
||||||
|
|
||||||
|
if (rate > this.network.maxFeeRate)
|
||||||
|
return this.network.maxFeeRate;
|
||||||
|
|
||||||
if (rate < 0)
|
if (rate < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|||||||
@ -46,6 +46,7 @@ function Network(options) {
|
|||||||
this.rpcPort = options.rpcPort;
|
this.rpcPort = options.rpcPort;
|
||||||
this.minRelay = options.minRelay;
|
this.minRelay = options.minRelay;
|
||||||
this.feeRate = options.feeRate;
|
this.feeRate = options.feeRate;
|
||||||
|
this.maxFeeRate = options.maxFeeRate;
|
||||||
this.selfConnect = options.selfConnect;
|
this.selfConnect = options.selfConnect;
|
||||||
this.requestMempool = options.requestMempool;
|
this.requestMempool = options.requestMempool;
|
||||||
this.batchSize = options.batchSize;
|
this.batchSize = options.batchSize;
|
||||||
|
|||||||
@ -419,6 +419,14 @@ main.minRelay = 10000;
|
|||||||
|
|
||||||
main.feeRate = 50000;
|
main.feeRate = 50000;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Maximum normal relay rate.
|
||||||
|
* @const {Rate}
|
||||||
|
* @default
|
||||||
|
*/
|
||||||
|
|
||||||
|
main.maxFeeRate = 150000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether to allow self-connection.
|
* Whether to allow self-connection.
|
||||||
* @const {Boolean}
|
* @const {Boolean}
|
||||||
@ -603,6 +611,8 @@ testnet.minRelay = 10000;
|
|||||||
|
|
||||||
testnet.feeRate = 20000;
|
testnet.feeRate = 20000;
|
||||||
|
|
||||||
|
testnet.maxFeeRate = 60000;
|
||||||
|
|
||||||
testnet.selfConnect = false;
|
testnet.selfConnect = false;
|
||||||
|
|
||||||
testnet.requestMempool = false;
|
testnet.requestMempool = false;
|
||||||
@ -748,6 +758,8 @@ regtest.minRelay = 10000;
|
|||||||
|
|
||||||
regtest.feeRate = 20000;
|
regtest.feeRate = 20000;
|
||||||
|
|
||||||
|
regtest.maxFeeRate = 60000;
|
||||||
|
|
||||||
regtest.selfConnect = true;
|
regtest.selfConnect = true;
|
||||||
|
|
||||||
regtest.requestMempool = true;
|
regtest.requestMempool = true;
|
||||||
@ -869,6 +881,8 @@ segnet3.minRelay = 10000;
|
|||||||
|
|
||||||
segnet3.feeRate = 20000;
|
segnet3.feeRate = 20000;
|
||||||
|
|
||||||
|
segnet3.maxFeeRate = 60000;
|
||||||
|
|
||||||
segnet3.selfConnect = false;
|
segnet3.selfConnect = false;
|
||||||
|
|
||||||
segnet3.requestMempool = true;
|
segnet3.requestMempool = true;
|
||||||
@ -1007,6 +1021,8 @@ segnet4.minRelay = 10000;
|
|||||||
|
|
||||||
segnet4.feeRate = 20000;
|
segnet4.feeRate = 20000;
|
||||||
|
|
||||||
|
segnet4.maxFeeRate = 60000;
|
||||||
|
|
||||||
segnet4.selfConnect = false;
|
segnet4.selfConnect = false;
|
||||||
|
|
||||||
segnet4.requestMempool = true;
|
segnet4.requestMempool = true;
|
||||||
@ -1153,6 +1169,8 @@ simnet.minRelay = 10000;
|
|||||||
|
|
||||||
simnet.feeRate = 20000;
|
simnet.feeRate = 20000;
|
||||||
|
|
||||||
|
simnet.maxFeeRate = 60000;
|
||||||
|
|
||||||
simnet.selfConnect = true;
|
simnet.selfConnect = true;
|
||||||
|
|
||||||
simnet.requestMempool = false;
|
simnet.requestMempool = false;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user