mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Merge #9942: Refactor CBlockPolicyEstimator
68af651MOVEONLY: move TxConfirmStats to cpp (Alex Morcos)2332f19Initialize TxConfirmStats in constructor (Alex Morcos)5ba81e5Read and Write fee estimate file directly from CBlockPolicyEstimator (Alex Morcos)14e10aaCall estimate(Smart)Fee directly from CBlockPolicyEstimator (Alex Morcos)dbb9e36Give CBlockPolicyEstimator it's own lock (Alex Morcos)f6187d6Make processBlockTx private. (Alex Morcos)ae7327bMake feeEstimator its own global instance of CBlockPolicyEstimator (Alex Morcos) Tree-SHA512: dbf3bd2b30822e609a35f3da519b62d23f8a50e564750695ddebd08553b4c01874ae3e07d792c6cc78cc377d2db33b951ffedc46ac7edaf5793f9ebb931713af
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "validation.h"
|
||||
#include "miner.h"
|
||||
#include "net.h"
|
||||
#include "policy/fees.h"
|
||||
#include "pow.h"
|
||||
#include "rpc/blockchain.h"
|
||||
#include "rpc/server.h"
|
||||
@@ -818,7 +819,7 @@ UniValue estimatefee(const JSONRPCRequest& request)
|
||||
if (nBlocks < 1)
|
||||
nBlocks = 1;
|
||||
|
||||
CFeeRate feeRate = mempool.estimateFee(nBlocks);
|
||||
CFeeRate feeRate = ::feeEstimator.estimateFee(nBlocks);
|
||||
if (feeRate == CFeeRate(0))
|
||||
return -1.0;
|
||||
|
||||
@@ -856,7 +857,7 @@ UniValue estimatesmartfee(const JSONRPCRequest& request)
|
||||
|
||||
UniValue result(UniValue::VOBJ);
|
||||
int answerFound;
|
||||
CFeeRate feeRate = mempool.estimateSmartFee(nBlocks, &answerFound);
|
||||
CFeeRate feeRate = ::feeEstimator.estimateSmartFee(nBlocks, &answerFound, ::mempool);
|
||||
result.push_back(Pair("feerate", feeRate == CFeeRate(0) ? -1.0 : ValueFromAmount(feeRate.GetFeePerK())));
|
||||
result.push_back(Pair("blocks", answerFound));
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user