mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Read and Write fee estimate file directly from CBlockPolicyEstimator
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
|
||||
#include "txmempool.h"
|
||||
|
||||
#include "clientversion.h"
|
||||
#include "consensus/consensus.h"
|
||||
#include "consensus/validation.h"
|
||||
#include "validation.h"
|
||||
@@ -16,7 +15,6 @@
|
||||
#include "util.h"
|
||||
#include "utilmoneystr.h"
|
||||
#include "utiltime.h"
|
||||
#include "version.h"
|
||||
|
||||
CTxMemPoolEntry::CTxMemPoolEntry(const CTransactionRef& _tx, const CAmount& _nFee,
|
||||
int64_t _nTime, unsigned int _entryHeight,
|
||||
@@ -843,38 +841,6 @@ TxMempoolInfo CTxMemPool::info(const uint256& hash) const
|
||||
return GetInfo(i);
|
||||
}
|
||||
|
||||
bool
|
||||
CTxMemPool::WriteFeeEstimates(CAutoFile& fileout) const
|
||||
{
|
||||
try {
|
||||
fileout << 139900; // version required to read: 0.13.99 or later
|
||||
fileout << CLIENT_VERSION; // version that wrote the file
|
||||
minerPolicyEstimator->Write(fileout);
|
||||
}
|
||||
catch (const std::exception&) {
|
||||
LogPrintf("CTxMemPool::WriteFeeEstimates(): unable to write policy estimator data (non-fatal)\n");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
CTxMemPool::ReadFeeEstimates(CAutoFile& filein)
|
||||
{
|
||||
try {
|
||||
int nVersionRequired, nVersionThatWrote;
|
||||
filein >> nVersionRequired >> nVersionThatWrote;
|
||||
if (nVersionRequired > CLIENT_VERSION)
|
||||
return error("CTxMemPool::ReadFeeEstimates(): up-version (%d) fee estimate file", nVersionRequired);
|
||||
minerPolicyEstimator->Read(filein, nVersionThatWrote);
|
||||
}
|
||||
catch (const std::exception&) {
|
||||
LogPrintf("CTxMemPool::ReadFeeEstimates(): unable to read policy estimator data (non-fatal)\n");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void CTxMemPool::PrioritiseTransaction(const uint256& hash, const CAmount& nFeeDelta)
|
||||
{
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user