Permalink
Browse files
Add function to report highest estimate target tracked per horizon
- Loading branch information...
Showing
with
22 additions
and
1 deletion.
-
+19
−1
src/policy/fees.cpp
-
+3
−0
src/policy/fees.h
|
|
@@ -684,7 +684,7 @@ CFeeRate CBlockPolicyEstimator::estimateRawFee(int confTarget, double successThr |
|
|
break;
|
|
|
}
|
|
|
default: {
|
|
|
- return CFeeRate(0);
|
|
|
+ throw std::out_of_range("CBlockPoicyEstimator::estimateRawFee unknown FeeEstimateHorizon");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -703,6 +703,24 @@ CFeeRate CBlockPolicyEstimator::estimateRawFee(int confTarget, double successThr |
|
|
return CFeeRate(median);
|
|
|
}
|
|
|
|
|
|
+unsigned int CBlockPolicyEstimator::HighestTargetTracked(FeeEstimateHorizon horizon) const
|
|
|
+{
|
|
|
+ switch (horizon) {
|
|
|
+ case FeeEstimateHorizon::SHORT_HALFLIFE: {
|
|
|
+ return shortStats->GetMaxConfirms();
|
|
|
+ }
|
|
|
+ case FeeEstimateHorizon::MED_HALFLIFE: {
|
|
|
+ return feeStats->GetMaxConfirms();
|
|
|
+ }
|
|
|
+ case FeeEstimateHorizon::LONG_HALFLIFE: {
|
|
|
+ return longStats->GetMaxConfirms();
|
|
|
+ }
|
|
|
+ default: {
|
|
|
+ throw std::out_of_range("CBlockPoicyEstimator::HighestTargetTracked unknown FeeEstimateHorizon");
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
unsigned int CBlockPolicyEstimator::BlockSpan() const
|
|
|
{
|
|
|
if (firstRecordedHeight == 0) return 0;
|
|
|
|
|
|
@@ -216,6 +216,9 @@ class CBlockPolicyEstimator |
|
|
/** Empty mempool transactions on shutdown to record failure to confirm for txs still in mempool */
|
|
|
void FlushUnconfirmed(CTxMemPool& pool);
|
|
|
|
|
|
+ /** Calculation of highest target that estimates are tracked for */
|
|
|
+ unsigned int HighestTargetTracked(FeeEstimateHorizon horizon) const;
|
|
|
+
|
|
|
private:
|
|
|
unsigned int nBestSeenHeight;
|
|
|
unsigned int firstRecordedHeight;
|
|
|
|
0 comments on commit
1fafd70