Skip to content

Commit

Permalink
remove dynamic fee code
Browse files Browse the repository at this point in the history
  • Loading branch information
EvgenijM86 committed Jan 29, 2019
1 parent 06e8b30 commit 10a0c5f
Show file tree
Hide file tree
Showing 21 changed files with 39 additions and 1,706 deletions.
2 changes: 0 additions & 2 deletions src/Makefile.am
Expand Up @@ -120,7 +120,6 @@ BITCOIN_CORE_H = \
netmessagemaker.h \
noui.h \
policy/feerate.h \
policy/fees.h \
policy/policy.h \
policy/rbf.h \
pow.h \
Expand Down Expand Up @@ -207,7 +206,6 @@ libbitcoin_server_a_SOURCES = \
net.cpp \
net_processing.cpp \
noui.cpp \
policy/fees.cpp \
policy/policy.cpp \
pow.cpp \
rest.cpp \
Expand Down
23 changes: 0 additions & 23 deletions src/init.cpp
Expand Up @@ -26,7 +26,6 @@
#include <net.h>
#include <net_processing.h>
#include <policy/feerate.h>
#include <policy/fees.h>
#include <policy/policy.h>
#include <rpc/server.h>
#include <rpc/register.h>
Expand Down Expand Up @@ -70,7 +69,6 @@
#include <zmq/zmqnotificationinterface.h>
#endif

bool fFeeEstimatesInitialized = false;
static const bool DEFAULT_PROXYRANDOMIZE = true;
static const bool DEFAULT_REST_ENABLE = false;
static const bool DEFAULT_STOPAFTERBLOCKIMPORT = false;
Expand All @@ -91,8 +89,6 @@ static CZMQNotificationInterface* pzmqNotificationInterface = nullptr;
#define MIN_CORE_FILEDESCRIPTORS 150
#endif

static const char* FEE_ESTIMATES_FILENAME="fee_estimates.dat";

//////////////////////////////////////////////////////////////////////////////
//
// Shutdown
Expand Down Expand Up @@ -214,18 +210,6 @@ void Shutdown()
DumpMempool();
}

if (fFeeEstimatesInitialized)
{
::feeEstimator.FlushUnconfirmed(::mempool);
fs::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME;
CAutoFile est_fileout(fsbridge::fopen(est_path, "wb"), SER_DISK, CLIENT_VERSION);
if (!est_fileout.IsNull())
::feeEstimator.Write(est_fileout);
else
LogPrintf("%s: Failed to write fee estimates to %s\n", __func__, est_path.string());
fFeeEstimatesInitialized = false;
}

// FlushStateToDisk generates a SetBestChain callback, which we should avoid missing
if (pcoinsTip != nullptr) {
FlushStateToDisk();
Expand Down Expand Up @@ -1556,13 +1540,6 @@ bool AppInitMain()
LogPrintf(" block index %15dms\n", GetTimeMillis() - nStart);
}

fs::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME;
CAutoFile est_filein(fsbridge::fopen(est_path, "rb"), SER_DISK, CLIENT_VERSION);
// Allowed to fail as this file IS missing on first startup.
if (!est_filein.IsNull())
::feeEstimator.Read(est_filein);
fFeeEstimatesInitialized = true;

// ********************************************************* Step 8: load wallet
#ifdef ENABLE_WALLET
if (!OpenWallets())
Expand Down
5 changes: 1 addition & 4 deletions src/net_processing.cpp
Expand Up @@ -16,7 +16,6 @@
#include <merkleblock.h>
#include <netmessagemaker.h>
#include <netbase.h>
#include <policy/fees.h>
#include <policy/policy.h>
#include <primitives/block.h>
#include <primitives/transaction.h>
Expand Down Expand Up @@ -3833,10 +3832,8 @@ bool PeerLogicValidation::SendMessages(CNode* pto, std::atomic<bool>& interruptM
int64_t timeNow = GetTimeMicros();
if (timeNow > pto->nextSendTimeFeeFilter) {
static CFeeRate default_feerate(DEFAULT_MIN_RELAY_TX_FEE);
static FeeFilterRounder filterRounder(default_feerate);
CAmount filterToSend = filterRounder.round(currentFilter);
// We always have a fee filter of at least minRelayTxFee
filterToSend = std::max(filterToSend, ::minRelayTxFee.GetFeePerK());
CAmount filterToSend = std::max(default_feerate.GetFeePerK(), ::minRelayTxFee.GetFeePerK());
if (filterToSend != pto->lastSentFeeFilter) {
connman->PushMessage(pto, msgMaker.Make(NetMsgType::FEEFILTER, filterToSend));
pto->lastSentFeeFilter = filterToSend;
Expand Down

0 comments on commit 10a0c5f

Please sign in to comment.