![]() |
Bitcoin Core 31.99.0
P2P Digital Currency
|
MemPoolFeeRateEstimatorCache holds a cache of recent fee rate estimates. More...
#include <mempool_estimator.h>
Classes | |
| struct | FeeRateEstimate |
Public Member Functions | |
| MemPoolFeeRateEstimatorCache ()=default | |
| MemPoolFeeRateEstimatorCache (const MemPoolFeeRateEstimatorCache &)=delete | |
| MemPoolFeeRateEstimatorCache & | operator= (const MemPoolFeeRateEstimatorCache &)=delete |
| bool | IsStale () const |
| Returns true if the cache is empty or older than CACHE_LIFE. More... | |
| std::optional< FeeRateEstimate > | GetCachedEstimate (const uint256 &tip_hash) const |
| Returns cached estimates if not stale and computed on tip_hash, nullopt otherwise. More... | |
| void | Update (FeePerVSize conservative, FeePerVSize economical, const uint256 &tip_hash) |
| Update the cache with new estimates computed on tip_hash. More... | |
| void | Clear () |
| Clear cached fee rate estimates. More... | |
Private Attributes | |
| std::optional< FeeRateEstimate > | m_fee_rate_estimation |
| uint256 | m_tip_hash |
| NodeClock::time_point | m_last_updated {} |
MemPoolFeeRateEstimatorCache holds a cache of recent fee rate estimates.
A cached fee rate is only provided while it is not older than CACHE_LIFE and the chain tip has not changed.
Definition at line 55 of file mempool_estimator.h.
|
default |
|
delete |
| void MemPoolFeeRateEstimatorCache::Clear | ( | ) |
Clear cached fee rate estimates.
Definition at line 135 of file mempool_estimator.cpp.
| std::optional< MemPoolFeeRateEstimatorCache::FeeRateEstimate > MemPoolFeeRateEstimatorCache::GetCachedEstimate | ( | const uint256 & | tip_hash | ) | const |
Returns cached estimates if not stale and computed on tip_hash, nullopt otherwise.
Definition at line 122 of file mempool_estimator.cpp.
| bool MemPoolFeeRateEstimatorCache::IsStale | ( | ) | const |
Returns true if the cache is empty or older than CACHE_LIFE.
Definition at line 116 of file mempool_estimator.cpp.
|
delete |
| void MemPoolFeeRateEstimatorCache::Update | ( | FeePerVSize | conservative, |
| FeePerVSize | economical, | ||
| const uint256 & | tip_hash | ||
| ) |
Update the cache with new estimates computed on tip_hash.
Definition at line 128 of file mempool_estimator.cpp.
|
private |
Definition at line 75 of file mempool_estimator.h.
|
private |
Definition at line 77 of file mempool_estimator.h.
|
private |
Definition at line 76 of file mempool_estimator.h.