5 #ifndef BITCOIN_POLICYESTIMATOR_H 6 #define BITCOIN_POLICYESTIMATOR_H 95 std::vector<std::vector<double> >
confAvg;
138 void Record(
int blocksToConfirm,
double val);
141 unsigned int NewTx(
unsigned int nBlockHeight,
double val);
144 void removeTx(
unsigned int entryHeight,
unsigned int nBestSeenHeight,
145 unsigned int bucketIndex);
163 double minSuccess,
bool requireGreater,
unsigned int nBlockHeight);
226 std::vector<CTxMemPoolEntry>& entries,
bool fCurrentEstimate);
static const double PRI_SPACING
std::vector< double > txCtAvg
double estimateSmartPriority(int confTarget, int *answerFoundAtTarget, const CTxMemPool &pool)
void processTransaction(const CTxMemPoolEntry &entry, bool fCurrentEstimate)
std::vector< std::vector< int > > unconfTxs
double EstimateMedianVal(int confTarget, double sufficientTxVal, double minSuccess, bool requireGreater, unsigned int nBlockHeight)
std::vector< int > curBlockTxCt
double minTrackedPriority
Passed to constructor to avoid dependency on main.
CBlockPolicyEstimator(const CFeeRate &minRelayFee)
std::string dataTypeString
static const CAmount MAX_MONEY
void Record(int blocksToConfirm, double val)
void Read(CAutoFile &filein)
static const double UNLIKELY_PCT
void ClearCurrent(unsigned int nBlockHeight)
static const double MIN_FEERATE
void UpdateMovingAverages()
static const double INF_FEERATE
static const double SUFFICIENT_PRITXS
CFeeRate estimateFee(int confTarget)
static const double MAX_PRIORITY
std::map< double, unsigned int > bucketMap
void processBlockTx(unsigned int nBlockHeight, const CTxMemPoolEntry &entry)
CFeeRate estimateSmartFee(int confTarget, int *answerFoundAtTarget, const CTxMemPool &pool)
unsigned int GetMaxConfirms()
unsigned int NewTx(unsigned int nBlockHeight, double val)
std::vector< double > avg
void Initialize(std::vector< double > &defaultBuckets, unsigned int maxConfirms, double decay, std::string dataTypeString)
std::vector< double > curBlockVal
void removeTx(unsigned int entryHeight, unsigned int nBestSeenHeight, unsigned int bucketIndex)
static const double SUFFICIENT_FEETXS
static const double DEFAULT_DECAY
static const double MIN_SUCCESS_PCT
void removeTx(uint256 hash)
static const double INF_PRIORITY
bool isFeeDataPoint(const CFeeRate &fee, double pri)
static const double MIN_PRIORITY
bool isPriDataPoint(const CFeeRate &fee, double pri)
static const double MAX_FEERATE
unsigned int nBestSeenHeight
Set to AllowFreeThreshold.
void Read(CAutoFile &filein)
void processBlock(unsigned int nBlockHeight, std::vector< CTxMemPoolEntry > &entries, bool fCurrentEstimate)
void Write(CAutoFile &fileout)
std::vector< int > oldUnconfTxs
std::vector< std::vector< double > > confAvg
std::vector< std::vector< int > > curBlockConf
std::map< uint256, TxStatsInfo > mapMemPoolTxs
void Write(CAutoFile &fileout)
static const unsigned int MAX_BLOCK_CONFIRMS
std::vector< double > buckets
double estimatePriority(int confTarget)
static const double FEE_SPACING