aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/blockchain.h
diff options
context:
space:
mode:
authorMarcin Jachymiak <marcin@bitcoinops.org>2018-08-08 14:40:56 -0400
committerMarcin Jachymiak <marcinja@mit.edu>2018-08-11 15:00:17 -0400
commit4b7091a842c2c3a76f4136cb0fdcf1c5904fd237 (patch)
tree1a0b0c33f182cddd27b9e230647a93064a88351e /src/rpc/blockchain.h
parentdf9f71274645a917e2578c52a1c59745bce8112d (diff)
Replace median fee rate with feerate percentiles
Removes medianfeerate result from getblockstats. Adds feerate_percentiles which give the feerate of the 10th, 25th, 50th, 75th, and 90th percentile weight unit in the block.
Diffstat (limited to 'src/rpc/blockchain.h')
-rw-r--r--src/rpc/blockchain.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/rpc/blockchain.h b/src/rpc/blockchain.h
index c664139ed3..544bc62c36 100644
--- a/src/rpc/blockchain.h
+++ b/src/rpc/blockchain.h
@@ -5,10 +5,16 @@
#ifndef BITCOIN_RPC_BLOCKCHAIN_H
#define BITCOIN_RPC_BLOCKCHAIN_H
+#include <vector>
+#include <stdint.h>
+#include <amount.h>
+
class CBlock;
class CBlockIndex;
class UniValue;
+static constexpr int NUM_GETBLOCKSTATS_PERCENTILES = 5;
+
/**
* Get the difficulty of the net wrt to the given block index, or the chain tip if
* not provided.
@@ -33,4 +39,7 @@ UniValue mempoolToJSON(bool fVerbose = false);
/** Block header to JSON */
UniValue blockheaderToJSON(const CBlockIndex* blockindex);
+/** Used by getblockstats to get feerates at different percentiles by weight */
+void CalculatePercentilesByWeight(CAmount result[NUM_GETBLOCKSTATS_PERCENTILES], std::vector<std::pair<CAmount, int64_t>>& scores, int64_t total_weight);
+
#endif