network: add maxFeeRate for fee estimation.

This commit is contained in:
Christopher Jeffrey 2016-11-05 18:19:19 -07:00
parent 60c64a6eba
commit cf5349cdaa
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
3 changed files with 22 additions and 0 deletions

View File

@ -697,6 +697,9 @@ PolicyEstimator.prototype.estimateFee = function estimateFee(target, smart) {
if (rate < this.network.feeRate)
return this.network.feeRate;
if (rate > this.network.maxFeeRate)
return this.network.maxFeeRate;
if (rate < 0)
return 0;

View File

@ -46,6 +46,7 @@ function Network(options) {
this.rpcPort = options.rpcPort;
this.minRelay = options.minRelay;
this.feeRate = options.feeRate;
this.maxFeeRate = options.maxFeeRate;
this.selfConnect = options.selfConnect;
this.requestMempool = options.requestMempool;
this.batchSize = options.batchSize;

View File

@ -419,6 +419,14 @@ main.minRelay = 10000;
main.feeRate = 50000;
/**
* Maximum normal relay rate.
* @const {Rate}
* @default
*/
main.maxFeeRate = 150000;
/**
* Whether to allow self-connection.
* @const {Boolean}
@ -603,6 +611,8 @@ testnet.minRelay = 10000;
testnet.feeRate = 20000;
testnet.maxFeeRate = 60000;
testnet.selfConnect = false;
testnet.requestMempool = false;
@ -748,6 +758,8 @@ regtest.minRelay = 10000;
regtest.feeRate = 20000;
regtest.maxFeeRate = 60000;
regtest.selfConnect = true;
regtest.requestMempool = true;
@ -869,6 +881,8 @@ segnet3.minRelay = 10000;
segnet3.feeRate = 20000;
segnet3.maxFeeRate = 60000;
segnet3.selfConnect = false;
segnet3.requestMempool = true;
@ -1007,6 +1021,8 @@ segnet4.minRelay = 10000;
segnet4.feeRate = 20000;
segnet4.maxFeeRate = 60000;
segnet4.selfConnect = false;
segnet4.requestMempool = true;
@ -1153,6 +1169,8 @@ simnet.minRelay = 10000;
simnet.feeRate = 20000;
simnet.maxFeeRate = 60000;
simnet.selfConnect = true;
simnet.requestMempool = false;