aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/mining.cpp
diff options
context:
space:
mode:
authorAlex Morcos <morcos@chaincode.com>2017-02-15 15:23:34 -0500
committerAlex Morcos <morcos@chaincode.com>2017-04-10 13:56:50 -0400
commit14e10aa842b8583f9648accd5d151dbdf342b9dc (patch)
treebd9cb352c1734d8ec7dbd87fee74b1f91e77644b /src/rpc/mining.cpp
parentdbb9e3699b8e835fd72a5db2c22927d828484c32 (diff)
downloadbitcoin-14e10aa842b8583f9648accd5d151dbdf342b9dc.tar.xz
Call estimate(Smart)Fee directly from CBlockPolicyEstimator
Diffstat (limited to 'src/rpc/mining.cpp')
-rw-r--r--src/rpc/mining.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp
index 7e5f0d608e..4aad267b8a 100644
--- a/src/rpc/mining.cpp
+++ b/src/rpc/mining.cpp
@@ -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"
@@ -819,7 +820,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;
@@ -857,7 +858,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;