Repository: zcash/zcash (language: rust)

Issue:
Remove `estimatefee` RPC call and estimation logic
[ZIP 317](https://zips.z.cash/zip-0317) has replaced this logic for calculating fees, and ZIP 317 fees can’t be estimated without the transaction they would be applied to, so this operation is no longer useful.

The fix to this should also remove the estimation logic, as it will have been removed from transaction creation by #6555.


Discussion / hints:

Fix patch:
diff --git a/doc/book/src/user/files.md b/doc/book/src/user/files.md
index 418c2bd6708..067aa488576 100644
--- a/doc/book/src/user/files.md
+++ b/doc/book/src/user/files.md
@@ -15,7 +15,6 @@ include:
 |``database/*``         | BDB database environment
 |``db.log``             | wallet database log file
 |``debug.log``          | contains debug information and general logging generated by zcashd
-|``fee_estimates.dat``  | stores statistics used to estimate minimum transaction fees and priorities required for confirmation
 |``peers.dat``          | peer IP address database (custom format)
 |``wallet.dat``         | personal wallet (BDB) with keys and transactions (keep private, back this up!)
 |``.cookie``            | session RPC authentication cookie (written at start when cookie authentication is used, deleted on shutdown)
diff --git a/doc/reduce-traffic.md b/doc/reduce-traffic.md
index e5ccd8ca299..20e19d0bb7a 100644
--- a/doc/reduce-traffic.md
+++ b/doc/reduce-traffic.md
@@ -44,7 +44,6 @@ with other peers, you can disable transaction relay.
 
 Be reminded of the effects of this setting.
 
-- Fee estimation will no longer work.
 - It sets the flag "-walletbroadcast" to be "0", only if it is currently unset.
   Doing so disables the automatic broadcasting of transactions from the wallet. Not
   relaying other's transactions could hurt your privacy if used while the wallet
diff --git a/doc/release-notes.md b/doc/release-notes.md
index 9bd59f75616..e0ed32b5e2a 100644
--- a/doc/release-notes.md
+++ b/doc/release-notes.md
@@ -3,3 +3,13 @@ release-notes at release time)
 
 Notable changes
 ===============
+
+Removal of Fee Estimation
+-------------------------
+
+The `estimatefee` RPC call, which estimated the fee needed for a transaction to
+be included within a target number of blocks, has been removed. The fee that
+should be paid under normal circumstances is the ZIP 317 conventional fee; it
+is not possible to compute that without knowing the number of logical actions
+in a transaction, which was not an input to `estimatefee`. The `fee_estimates.dat`
+file is no longer used.
diff --git a/src/Makefile.am b/src/Makefile.am
index a66bed8a663..d21031e22b9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -260,7 +260,6 @@ BITCOIN_CORE_H = \
   net.h \
   netbase.h \
   noui.h \
-  policy/fees.h \
   policy/policy.h \
   pow.h \
   prevector.h \
@@ -373,7 +372,6 @@ libbitcoin_server_a_SOURCES = \
   miner.cpp \
   net.cpp \
   noui.cpp \
-  policy/fees.cpp \
   policy/policy.cpp \
   pow.cpp \
   rest.cpp \
diff --git a/src/amount.cpp b/src/amount.cpp
index 948cd3143bc..82c4074a0ab 100644
--- a/src/amount.cpp
+++ b/src/amount.cpp
@@ -6,7 +6,6 @@
 
 #include "amount.h"
 #include "consensus/consensus.h"
-#include "policy/fees.h"
 
 #include "tinyformat.h"
 
@@ -24,7 +23,7 @@ CFeeRate::CFeeRate(const CAmount& nFeePaid, size_t nSize)
 
 CAmount CFeeRate::GetFeeForRelay(size_t nSize) const
 {
-    return std::min(GetFee(nSize), DEFAULT_FEE);
+    return std::min(GetFee(nSize), LEGACY_DEFAULT_FEE);
 }
 
 CAmount CFeeRate::GetFee(size_t nSize) const
diff --git a/src/amount.h b/src/amount.h
index 44991b26d66..7b8f5d90934 100644
--- a/src/amount.h
+++ b/src/amount.h
@@ -32,6 +32,9 @@ extern const std::string MINOR_CURRENCY_UNIT;
 static const CAmount MAX_MONEY = 21000000 * COIN;
 inline bool MoneyRange(const CAmount& nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }
 
+/** The legacy default fee that was defined in ZIP 313. */
+static const CAmount LEGACY_DEFAULT_FEE = 1000;
+
 /** Type-safe wrapper class to for fee rates
  * (how much to pay based on transaction size)
  */
diff --git a/src/coins.cpp b/src/coins.cpp
index b6f4e047105..81eb6da238e 100644
--- a/src/coins.cpp
+++ b/src/coins.cpp
@@ -8,7 +8,6 @@
 #include "memusage.h"
 #include "random.h"
 #include "version.h"
-#include "policy/fees.h"
 
 #include <assert.h>
 
diff --git a/src/fuzzing/ReadFeeEstimates/fuzz.cpp b/src/fuzzing/ReadFeeEstimates/fuzz.cpp
deleted file mode 100644
index e066fc792a8..00000000000
--- a/src/fuzzing/ReadFeeEstimates/fuzz.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-#include "txmempool.h"
-
-#ifdef FUZZ_WITH_AFL
-
-int main (int argc, char *argv[]) {
-    CFeeRate rate;
-    CTxMemPool mempool(rate);
-    CAutoFile est_filein(fopen(argv[1], "rb"), SER_DISK, CLIENT_VERSION);
-
-    if (mempool.ReadFeeEstimates(est_filein)) {
-        return 0;
-    } else {
-        return -1;
-    }
-}
-
-#endif
-
-#ifdef FUZZ_WITH_LIBFUZZER
-
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
-    CFeeRate rate;
-    CTxMemPool mempool(rate);
-    CAutoFile est_filein(fmemopen(Data, Size, "rb"), SER_DISK, CLIENT_VERSION);
-
-    if (mempool.ReadFeeEstimates(est_filein)) {
-        return 0;
-    } else {
-        return -1;
-    }
-}
-
-
-#endif
diff --git a/src/fuzzing/ReadFeeEstimates/input/fee_estimates.dat b/src/fuzzing/ReadFeeEstimates/input/fee_estimates.dat
deleted file mode 100644
index c3c5961ac55..00000000000
Binary files a/src/fuzzing/ReadFeeEstimates/input/fee_estimates.dat and /dev/null differ
diff --git a/src/init.cpp b/src/init.cpp
index c2867b9a211..114b1f8383e 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -81,7 +81,6 @@ extern void ThreadSendAlert();
 
 TracingHandle* pTracingHandle = nullptr;
 
-bool fFeeEstimatesInitialized = false;
 static const bool DEFAULT_PROXYRANDOMIZE = true;
 static const bool DEFAULT_REST_ENABLE = false;
 static const bool DEFAULT_DISABLE_SAFEMODE = false;
@@ -112,7 +111,6 @@ enum BindFlags {
     BF_WHITELIST    = (1U << 2),
 };
 
-static const char* FEE_ESTIMATES_FILENAME="fee_estimates.dat";
 CClientUIInterface uiInterface; // Declared but not defined in ui_interface.h
 
 //////////////////////////////////////////////////////////////////////////////
@@ -220,17 +218,6 @@ void Shutdown()
     StopTorControl();
     UnregisterNodeSignals(GetNodeSignals());
 
-    if (fFeeEstimatesInitialized)
-    {
-        fs::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME;
-        CAutoFile est_fileout(fsbridge::fopen(est_path, "wb"), SER_DISK, CLIENT_VERSION);
-        if (!est_fileout.IsNull())
-            mempool.WriteFeeEstimates(est_fileout);
-        else
-            LogPrintf("%s: Failed to write fee estimates to %s\n", __func__, est_path.string());
-        fFeeEstimatesInitialized = false;
-    }
-
     {
         LOCK(cs_main);
         if (pcoinsTip != NULL) {
@@ -466,7 +453,7 @@ std::string HelpMessage(HelpMessageMode mode)
                 "-fundingstream=streamId:startHeight:endHeight:comma_delimited_addresses",
                 "Use given addresses for block subsidy share paid to the funding stream with id <streamId> (regtest-only)");
     }
-    std::string debugCategories = "addrman, alert, bench, coindb, db, estimatefee, http, libevent, lock, mempool, mempoolrej, net, partitioncheck, pow, proxy, prune, "
+    std::string debugCategories = "addrman, alert, bench, coindb, db, http, libevent, lock, mempool, mempoolrej, net, partitioncheck, pow, proxy, prune, "
                              "rand, receiveunsafe, reindex, rpc, selectcoins, tor, zmq, zrpc, zrpcunsafe (implies zrpc)"; // Don't translate these
     strUsage += HelpMessageOpt("-debug=<category>", strprintf(_("Output debugging information (default: %u, supplying <category> is optional)"), 0) + ". " +
         _("If <category> is not supplied or if <category> = 1, output all debugging information.") + " " + _("<category> can be:") + " " + debugCategories + ". " +
@@ -1859,14 +1846,6 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
     }
     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())
-        mempool.ReadFeeEstimates(est_filein);
-    fFeeEstimatesInitialized = true;
-
-
     // ********************************************************* Step 8: load wallet
 #ifdef ENABLE_WALLET
     if (fDisableWallet) {
diff --git a/src/main.cpp b/src/main.cpp
index ec83157f5b9..e3fbb9d7755 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1937,7 +1937,7 @@ bool AcceptToMemoryPool(
 
         // No transactions are allowed with modified fee below the minimum relay fee,
         // except from disconnected blocks. The minimum relay fee will never be more
-        // than DEFAULT_FEE zatoshis.
+        // than LEGACY_DEFAULT_FEE zatoshis.
         CAmount minRelayFee = ::minRelayTxFee.GetFeeForRelay(nSize);
         if (fLimitFree && nModifiedFees < minRelayFee) {
             LogPrint("mempool",
@@ -2028,7 +2028,7 @@ bool AcceptToMemoryPool(
 
         {
             // Store transaction in memory
-            pool.addUnchecked(hash, entry, setAncestors, !IsInitialBlockDownload(chainparams.GetConsensus()));
+            pool.addUnchecked(hash, entry, setAncestors);
 
             // Add memory address index
             if (fAddressIndex) {
@@ -4090,7 +4090,7 @@ bool static ConnectTip(CValidationState& state, const CChainParams& chainparams,
     LogPrint("bench", "  - Writing chainstate: %.2fms [%.2fs]\n", (nTime5 - nTime4) * 0.001, nTimeChainState * 0.000001);
     // Remove conflicting transactions from the mempool.
     std::list<CTransaction> txConflicted;
-    mempool.removeForBlock(pblock->vtx, pindexNew->nHeight, txConflicted, !IsInitialBlockDownload(chainparams.GetConsensus()));
+    mempool.removeForBlock(pblock->vtx, pindexNew->nHeight, txConflicted);
 
     // Remove transactions that expire at new block height from mempool
     auto ids = mempool.removeExpired(pindexNew->nHeight);
diff --git a/src/mempool_limit.h b/src/mempool_limit.h
index b9a7ffee5e3..8ca26657e5a 100644
--- a/src/mempool_limit.h
+++ b/src/mempool_limit.h
@@ -13,7 +13,6 @@
 #include "logging.h"
 #include "random.h"
 #include "primitives/transaction.h"
-#include "policy/fees.h"
 #include "uint256.h"
 #include "util/time.h"
 #include "weighted_map.h"
diff --git a/src/miner.cpp b/src/miner.cpp
index a800fe5d3fd..dd8b2c99c87 100644
--- a/src/miner.cpp
+++ b/src/miner.cpp
@@ -64,17 +64,6 @@ using namespace std;
 std::optional<uint64_t> last_block_num_txs;
 std::optional<uint64_t> last_block_size;
 
-class ScoreCompare
-{
-public:
-    ScoreCompare() {}
-
-    bool operator()(const CTxMemPool::txiter a, const CTxMemPool::txiter b)
-    {
-        return CompareTxMemPoolEntryByScore()(*b,*a); // Convert to less than
-    }
-};
-
 int64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev)
 {
     int64_t nOldTime = pblock->nTime;
diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp
deleted file mode 100644
index 49fd4c293e9..00000000000
--- a/src/policy/fees.cpp
+++ /dev/null
@@ -1,441 +0,0 @@
-// Copyright (c) 2009-2010 Satoshi Nakamoto
-// Copyright (c) 2009-2015 The Bitcoin developers
-// Distributed under the MIT software license, see the accompanying
-// file COPYING or https://www.opensource.org/licenses/mit-license.php .
-
-#include "policy/fees.h"
-
-#include "amount.h"
-#include "primitives/transaction.h"
-#include "streams.h"
-#include "txmempool.h"
-#include "util/system.h"
-
-void TxConfirmStats::Initialize(std::vector<double>& defaultBuckets,
-                                unsigned int maxConfirms, double _decay)
-{
-    decay = _decay;
-
-    buckets.insert(buckets.end(), defaultBuckets.begin(), defaultBuckets.end());
-    buckets.push_back(std::numeric_limits<double>::infinity());
-
-    for (unsigned int i = 0; i < buckets.size(); i++) {
-        bucketMap[buckets[i]] = i;
-    }
-
-    confAvg.resize(maxConfirms);
-    curBlockConf.resize(maxConfirms);
-    unconfTxs.resize(maxConfirms);
-    for (unsigned int i = 0; i < maxConfirms; i++) {
-        confAvg[i].resize(buckets.size());
-        curBlockConf[i].resize(buckets.size());
-        unconfTxs[i].resize(buckets.size());
-    }
-
-    oldUnconfTxs.resize(buckets.size());
-    curBlockTxCt.resize(buckets.size());
-    txCtAvg.resize(buckets.size());
-    curBlockVal.resize(buckets.size());
-    avg.resize(buckets.size());
-}
-
-// Zero out the data for the current block
-void TxConfirmStats::ClearCurrent(unsigned int nBlockHeight)
-{
-    for (unsigned int j = 0; j < buckets.size(); j++) {
-        oldUnconfTxs[j] += unconfTxs[nBlockHeight%unconfTxs.size()][j];
-        unconfTxs[nBlockHeight%unconfTxs.size()][j] = 0;
-        for (unsigned int i = 0; i < curBlockConf.size(); i++)
-            curBlockConf[i][j] = 0;
-        curBlockTxCt[j] = 0;
-        curBlockVal[j] = 0;
-    }
-}
-
-unsigned int TxConfirmStats::FindBucketIndex(double val)
-{
-    auto it = bucketMap.lower_bound(val);
-    assert(it != bucketMap.end());
-    return it->second;
-}
-
-void TxConfirmStats::Record(int blocksToConfirm, double val)
-{
-    // blocksToConfirm is 1-based
-    if (blocksToConfirm < 1)
-        return;
-    unsigned int bucketindex = FindBucketIndex(val);
-    for (size_t i = blocksToConfirm; i <= curBlockConf.size(); i++) {
-        curBlockConf[i - 1][bucketindex]++;
-    }
-    curBlockTxCt[bucketindex]++;
-    curBlockVal[bucketindex] += val;
-}
-
-void TxConfirmStats::UpdateMovingAverages()
-{
-    for (unsigned int j = 0; j < buckets.size(); j++) {
-        for (unsigned int i = 0; i < confAvg.size(); i++)
-            confAvg[i][j] = confAvg[i][j] * decay + curBlockConf[i][j];
-        avg[j] = avg[j] * decay + curBlockVal[j];
-        txCtAvg[j] = txCtAvg[j] * decay + curBlockTxCt[j];
-    }
-}
-
-// returns -1 on error conditions
-double TxConfirmStats::EstimateMedianVal(int confTarget, double sufficientTxVal,
-                                         double successBreakPoint, bool requireGreater,
-                                         unsigned int nBlockHeight)
-{
-    // Counters for a bucket (or range of buckets)
-    double nConf = 0; // Number of tx's confirmed within the confTarget
-    double totalNum = 0; // Total number of tx's that were ever confirmed
-    int extraNum = 0;  // Number of tx's still in mempool for confTarget or longer
-
-    int maxbucketindex = buckets.size() - 1;
-
-    // requireGreater means we are looking for the lowest feerate such that all higher
-    // values pass, so we start at maxbucketindex (highest feerate) and look at successively
-    // smaller buckets until we reach failure.  Otherwise, we are looking for the highest
-    // feerate such that all lower values fail, and we go in the opposite direction.
-    unsigned int startbucket = requireGreater ? maxbucketindex : 0;
-    int step = requireGreater ? -1 : 1;
-
-    // We'll combine buckets until we have enough samples.
-    // The near and far variables will define the range we've combined
-    // The best variables are the last range we saw which still had a high
-    // enough confirmation rate to count as success.
-    // The cur variables are the current range we're counting.
-    unsigned int curNearBucket = startbucket;
-    unsigned int bestNearBucket = startbucket;
-    unsigned int curFarBucket = startbucket;
-    unsigned int bestFarBucket = startbucket;
-
-    bool foundAnswer = false;
-    unsigned int bins = unconfTxs.size();
-
-    // Start counting from highest(default) or lowest feerate transactions
-    for (int bucket = startbucket; bucket >= 0 && bucket <= maxbucketindex; bucket += step) {
-        curFarBucket = bucket;
-        nConf += confAvg[confTarget - 1][bucket];
-        totalNum += txCtAvg[bucket];
-        for (unsigned int confct = confTarget; confct < GetMaxConfirms(); confct++)
-            extraNum += unconfTxs[(nBlockHeight - confct)%bins][bucket];
-        extraNum += oldUnconfTxs[bucket];
-        // If we have enough transaction data points in this range of buckets,
-        // we can test for success
-        // (Only count the confirmed data points, so that each confirmation count
-        // will be looking at the same amount of data and same bucket breaks)
-        if (totalNum >= sufficientTxVal / (1 - decay)) {
-            double curPct = nConf / (totalNum + extraNum);
-
-            // Check to see if we are no longer getting confirmed at the success rate
-            if (requireGreater && curPct < successBreakPoint)
-                break;
-            if (!requireGreater && curPct > successBreakPoint)
-                break;
-
-            // Otherwise update the cumulative stats, and the bucket variables
-            // and reset the counters
-            else {
-                foundAnswer = true;
-                nConf = 0;
-                totalNum = 0;
-                extraNum = 0;
-                bestNearBucket = curNearBucket;
-                bestFarBucket = curFarBucket;
-                curNearBucket = bucket + step;
-            }
-        }
-    }
-
-    double median = -1;
-    double txSum = 0;
-
-    // Calculate the "average" feerate of the best bucket range that met success conditions
-    // Find the bucket with the median transaction and then report the average feerate from that bucket
-    // This is a compromise between finding the median which we can't since we don't save all tx's
-    // and reporting the average which is less accurate
-    unsigned int minBucket = bestNearBucket < bestFarBucket ? bestNearBucket : bestFarBucket;
-    unsigned int maxBucket = bestNearBucket > bestFarBucket ? bestNearBucket : bestFarBucket;
-    for (unsigned int j = minBucket; j <= maxBucket; j++) {
-        txSum += txCtAvg[j];
-    }
-    if (foundAnswer && txSum != 0) {
-        txSum = txSum / 2;
-        for (unsigned int j = minBucket; j <= maxBucket; j++) {
-            if (txCtAvg[j] < txSum)
-                txSum -= txCtAvg[j];
-            else { // we're in the right bucket
-                median = avg[j] / txCtAvg[j];
-                break;
-            }
-        }
-    }
-
-    LogPrint("estimatefee", "%3d: For conf success %s %4.2f need feerate %s: %12.5g from buckets %8g - %8g  Cur Bucket stats %6.2f%%  %8.1f/(%.1f+%d mempool)\n",
-             confTarget, requireGreater ? ">" : "<", successBreakPoint,
-             requireGreater ? ">" : "<", median, buckets[minBucket], buckets[maxBucket],
-             100 * nConf / (totalNum + extraNum), nConf, totalNum, extraNum);
-
-    return median;
-}
-
-void TxConfirmStats::Write(CAutoFile& fileout)
-{
-    fileout << decay;
-    fileout << buckets;
-    fileout << avg;
-    fileout << txCtAvg;
-    fileout << confAvg;
-}
-
-void TxConfirmStats::Read(CAutoFile& filein)
-{
-    // Read data file into temporary variables and do some very basic sanity checking
-    std::vector<double> fileBuckets;
-    std::vector<double> fileAvg;
-    std::vector<std::vector<double> > fileConfAvg;
-    std::vector<double> fileTxCtAvg;
-    double fileDecay;
-    size_t maxConfirms;
-    size_t numBuckets;
-
-    filein >> fileDecay;
-    if (fileDecay <= 0 || fileDecay >= 1)
-        throw std::runtime_error("Corrupt estimates file. Decay must be between 0 and 1 (non-inclusive)");
-    filein >> fileBuckets;
-    numBuckets = fileBuckets.size();
-    if (numBuckets <= 1 || numBuckets > 1000)
-        throw std::runtime_error("Corrupt estimates file. Must have between 2 and 1000 feerate buckets");
-    filein >> fileAvg;
-    if (fileAvg.size() != numBuckets)
-        throw std::runtime_error("Corrupt estimates file. Mismatch in feerate average bucket count");
-    filein >> fileTxCtAvg;
-    if (fileTxCtAvg.size() != numBuckets)
-        throw std::runtime_error("Corrupt estimates file. Mismatch in tx count bucket count");
-    filein >> fileConfAvg;
-    maxConfirms = fileConfAvg.size();
-    if (maxConfirms <= 0 || maxConfirms > 6 * 24 * 7) // one week
-        throw std::runtime_error("Corrupt estimates file.  Must maintain estimates for between 1 and 1008 (one week) confirms");
-    for (unsigned int i = 0; i < maxConfirms; i++) {
-        if (fileConfAvg[i].size() != numBuckets)
-            throw std::runtime_error("Corrupt estimates file. Mismatch in feerate conf average bucket count");
-    }
-    // Now that we've processed the entire feerate estimate data file and not
-    // thrown any errors, we can copy it to our data structures
-    decay = fileDecay;
-    buckets = fileBuckets;
-    avg = fileAvg;
-    confAvg = fileConfAvg;
-    txCtAvg = fileTxCtAvg;
-    bucketMap.clear();
-
-    // Resize the current block variables which aren't stored in the data file
-    // to match the number of confirms and buckets
-    curBlockConf.resize(maxConfirms);
-    for (unsigned int i = 0; i < maxConfirms; i++) {
-        curBlockConf[i].resize(buckets.size());
-    }
-    curBlockTxCt.resize(buckets.size());
-    curBlockVal.resize(buckets.size());
-
-    unconfTxs.resize(maxConfirms);
-    for (unsigned int i = 0; i < maxConfirms; i++) {
-        unconfTxs[i].resize(buckets.size());
-    }
-    oldUnconfTxs.resize(buckets.size());
-
-    for (unsigned int i = 0; i < buckets.size(); i++)
-        bucketMap[buckets[i]] = i;
-
-    LogPrint("estimatefee", "Reading estimates: %u buckets counting confirms up to %u blocks\n",
-             numBuckets, maxConfirms);
-}
-
-unsigned int TxConfirmStats::NewTx(unsigned int nBlockHeight, double val)
-{
-    unsigned int bucketindex = FindBucketIndex(val);
-    unsigned int blockIndex = nBlockHeight % unconfTxs.size();
-    unconfTxs[blockIndex][bucketindex]++;
-    return bucketindex;
-}
-
-void TxConfirmStats::removeTx(unsigned int entryHeight, unsigned int nBestSeenHeight, unsigned int bucketindex)
-{
-    //nBestSeenHeight is not updated yet for the new block
-    int blocksAgo = nBestSeenHeight - entryHeight;
-    if (nBestSeenHeight == 0)  // the BlockPolicyEstimator hasn't seen any blocks yet
-        blocksAgo = 0;
-    if (blocksAgo < 0) {
-        LogPrint("estimatefee", "Blockpolicy error, blocks ago is negative for mempool tx\n");
-        return;  //This can't happen because we call this with our best seen height, no entries can have higher
-    }
-
-    if (blocksAgo >= (int)unconfTxs.size()) {
-        if (oldUnconfTxs[bucketindex] > 0)
-            oldUnconfTxs[bucketindex]--;
-        else
-            LogPrint("estimatefee", "Blockpolicy error, mempool tx removed from >25 blocks,bucketIndex=%u already\n",
-                     bucketindex);
-    }
-    else {
-        unsigned int blockIndex = entryHeight % unconfTxs.size();
-        if (unconfTxs[blockIndex][bucketindex] > 0)
-            unconfTxs[blockIndex][bucketindex]--;
-        else
-            LogPrint("estimatefee", "Blockpolicy error, mempool tx removed from blockIndex=%u,bucketIndex=%u already\n",
-                     blockIndex, bucketindex);
-    }
-}
-
-void CBlockPolicyEstimator::removeTx(uint256 hash)
-{
-    std::map<uint256, TxStatsInfo>::iterator pos = mapMemPoolTxs.find(hash);
-    if (pos == mapMemPoolTxs.end()) {
-        LogPrint("estimatefee", "Blockpolicy error mempool tx %s not found for removeTx\n",
-                 hash.ToString().c_str());
-        return;
-    }
-    unsigned int entryHeight = pos->second.blockHeight;
-    unsigned int bucketIndex = pos->second.bucketIndex;
-
-    feeStats.removeTx(entryHeight, nBestSeenHeight, bucketIndex);
-    mapMemPoolTxs.erase(hash);
-}
-
-CBlockPolicyEstimator::CBlockPolicyEstimator(const CFeeRate& _minRelayFee)
-    : nBestSeenHeight(0)
-{
-    minTrackedFee = _minRelayFee < CFeeRate(MIN_FEERATE) ? CFeeRate(MIN_FEERATE) : _minRelayFee;
-    std::vector<double> vfeelist;
-    for (double bucketBoundary = minTrackedFee.GetFeePerK(); bucketBoundary <= MAX_FEERATE; bucketBoundary *= FEE_SPACING) {
-        vfeelist.push_back(bucketBoundary);
-    }
-    feeStats.Initialize(vfeelist, MAX_BLOCK_CONFIRMS, DEFAULT_DECAY);
-}
-
-void CBlockPolicyEstimator::processTransaction(const CTxMemPoolEntry& entry, bool fCurrentEstimate)
-{
-    unsigned int txHeight = entry.GetHeight();
-    uint256 hash = entry.GetTx().GetHash();
-    if (mapMemPoolTxs.count(hash)) {
-        LogPrint("estimatefee", "Blockpolicy error mempool tx %s already being tracked\n",
-                 hash.ToString().c_str());
-        return;
-    }
-
-    if (txHeight < nBestSeenHeight) {
-        // Ignore side chains and re-orgs; assuming they are random they don't
-        // affect the estimate.  We'll potentially double count transactions in 1-block reorgs.
-        return;
-    }
-
-    // Only want to be updating estimates when our blockchain is synced,
-    // otherwise we'll miscalculate how many blocks its taking to get included.
-    if (!fCurrentEstimate)
-        return;
-
-    if (!entry.WasClearAtEntry()) {
-        // This transaction depends on other transactions in the mempool to
-        // be included in a block before it will be able to be included, so
-        // we shouldn't include it in our calculations
-        return;
-    }
-
-    // Feerates are stored and reported as zatoshis per 1000 bytes:
-    CFeeRate feeRate(entry.GetFee(), entry.GetTxSize());
-
-    mapMemPoolTxs[hash].blockHeight = txHeight;
-    mapMemPoolTxs[hash].bucketIndex = feeStats.NewTx(txHeight, (double)feeRate.GetFeePerK());
-}
-
-void CBlockPolicyEstimator::processBlockTx(unsigned int nBlockHeight, const CTxMemPoolEntry& entry)
-{
-    if (!entry.WasClearAtEntry()) {
-        // This transaction depended on other transactions in the mempool to
-        // be included in a block before it was able to be included, so
-        // we shouldn't include it in our calculations
-        return;
-    }
-
-    // How many blocks did it take for miners to include this transaction?
-    // blocksToConfirm is 1-based, so a transaction included in the earliest
-    // possible block has confirmation count of 1
-    int blocksToConfirm = nBlockHeight - entry.GetHeight();
-    if (blocksToConfirm <= 0) {
-        // This can't happen because we don't process transactions from a block with a height
-        // lower than our greatest seen height
-        LogPrint("estimatefee", "Blockpolicy error Transaction had negative blocksToConfirm\n");
-        return;
-    }
-
-    // Feerates are stored and reported as zatoshis per 1000 bytes:
-    CFeeRate feeRate(entry.GetFee(), entry.GetTxSize());
-
-    feeStats.Record(blocksToConfirm, (double)feeRate.GetFeePerK());
-}
-
-void CBlockPolicyEstimator::processBlock(unsigned int nBlockHeight,
-                                         std::vector<CTxMemPoolEntry>& entries, bool fCurrentEstimate)
-{
-    if (nBlockHeight <= nBestSeenHeight) {
-        // Ignore side chains and re-orgs; assuming they are random
-        // they don't affect the estimate.
-        // And if an attacker can re-org the chain at will, then
-        // you've got much bigger problems than "attacker can influence
-        // transaction fees."
-        return;
-    }
-    nBestSeenHeight = nBlockHeight;
-
-    // Only want to be updating estimates when our blockchain is synced,
-    // otherwise we'll miscalculate how many blocks its taking to get included.
-    if (!fCurrentEstimate)
-        return;
-
-    // Clear the current block state
-    feeStats.ClearCurrent(nBlockHeight);
-
-    // Repopulate the current block states
-    for (unsigned int i = 0; i < entries.size(); i++)
-        processBlockTx(nBlockHeight, entries[i]);
-
-    // Update all exponential averages with the current block state
-    feeStats.UpdateMovingAverages();
-
-    LogPrint("estimatefee", "Blockpolicy after updating estimates for %u confirmed entries, new mempool map size %u\n",
-             entries.size(), mapMemPoolTxs.size());
-}
-
-CFeeRate CBlockPolicyEstimator::estimateFee(int confTarget)
-{
-    // Return failure if trying to analyze a target we're not tracking
-    if (confTarget <= 0 || (unsigned int)confTarget > feeStats.GetMaxConfirms())
-        return CFeeRate(0);
-
-    double median = feeStats.EstimateMedianVal(confTarget, SUFFICIENT_FEETXS, MIN_SUCCESS_PCT, true, nBestSeenHeight);
-
-    if (median < 0)
-        return CFeeRate(0);
-
-    return CFeeRate(median);
-}
-
-void CBlockPolicyEstimator::Write(CAutoFile& fileout)
-{
-    fileout << nBestSeenHeight;
-    feeStats.Write(fileout);
-}
-
-void CBlockPolicyEstimator::Read(CAutoFile& filein, int nFileVersion)
-{
-    int nFileBestSeenHeight;
-    filein >> nFileBestSeenHeight;
-    feeStats.Read(filein);
-    nBestSeenHeight = nFileBestSeenHeight;
-    if (nFileVersion < FEE_ESTIMATES_WITHOUT_PRIORITY_VERSION) {
-        TxConfirmStats priStats;
-        priStats.Read(filein);
-    }
-}
diff --git a/src/policy/fees.h b/src/policy/fees.h
deleted file mode 100644
index 1618ec4c82f..00000000000
--- a/src/policy/fees.h
+++ /dev/null
@@ -1,249 +0,0 @@
-// Copyright (c) 2009-2010 Satoshi Nakamoto
-// Copyright (c) 2009-2015 The Bitcoin developers
-// Distributed under the MIT software license, see the accompanying
-// file COPYING or https://www.opensource.org/licenses/mit-license.php .
-#ifndef BITCOIN_POLICY_FEES_H
-#define BITCOIN_POLICY_FEES_H
-
-#include "amount.h"
-#include "uint256.h"
-
-#include <map>
-#include <string>
-#include <vector>
-
-static const CAmount DEFAULT_FEE = 1000;
-
-class CAutoFile;
-class CFeeRate;
-class CTxMemPoolEntry;
-
-/** \class CBlockPolicyEstimator
- * The BlockPolicyEstimator is used for estimating the feerate needed
- * for a transaction to be included in a block within a certain number of
- * blocks.
- *
- * At a high level the algorithm works by grouping transactions into buckets
- * based on having similar feerates and then tracking how long it
- * takes transactions in the various buckets to be mined.  It operates under
- * the assumption that in general transactions of higher feerate will be
- * included in blocks before transactions of lower feerate.   So for
- * example if you wanted to know what feerate you should put on a transaction to
- * be included in a block within the next 5 blocks, you would start by looking
- * at the bucket with the highest feerate transactions and verifying that a
- * sufficiently high percentage of them were confirmed within 5 blocks and
- * then you would look at the next highest feerate bucket, and so on, stopping at
- * the last bucket to pass the test.   The average feerate of transactions in this
- * bucket will give you an indication of the lowest feerate you can put on a
- * transaction and still have a sufficiently high chance of being confirmed
- * within your desired 5 blocks.
- *
- * Here is a brief description of the implementation:
- * When a transaction enters the mempool, we
- * track the height of the block chain at entry.  Whenever a block comes in,
- * we count the number of transactions in each bucket and the total amount of feerate
- * paid in each bucket. Then we calculate how many blocks Y it took each
- * transaction to be mined and we track an array of counters in each bucket
- * for how long it to took transactions to get confirmed from 1 to a max of 25
- * and we increment all the counters from Y up to 25. This is because for any
- * number Z>=Y the transaction was successfully mined within Z blocks.  We
- * want to save a history of this information, so at any time we have a
- * counter of the total number of transactions that happened in a given feerate
- * bucket and the total number that were confirmed in each number 1-25 blocks
- * or less for any bucket.   We save this history by keeping an exponentially
- * decaying moving average of each one of these stats.  Furthermore we also
- * keep track of the number unmined (in mempool) transactions in each bucket
- * and for how many blocks they have been outstanding and use that to increase
- * the number of transactions we've seen in that feerate bucket when calculating
- * an estimate for any number of confirmations below the number of blocks
- * they've been outstanding.
- */
-
-/** Decay of .998 is a half-life of 346 blocks or about 2.4 days */
-static const double DEFAULT_DECAY = .998;
-
-/**
- * We will instantiate an instance of this class to track transactions that were
- * included in a block. We will lump transactions into a bucket according to their
- * approximate feerate and then track how long it took for those txs to be included
- * in a block. There is always a bucket into which any given double value
- * (representing a fee) falls.
- *
- * The tracking of unconfirmed (mempool) transactions is completely independent of the
- * historical tracking of transactions that have been confirmed in a block.
- */
-class TxConfirmStats
-{
-private:
-    //Define the buckets we will group transactions into
-    std::vector<double> buckets;              // The upper-bound of the range for the bucket (inclusive)
-    std::map<double, unsigned int> bucketMap; // Map of bucket upper-bound to index into all vectors by bucket
-
-    // For each bucket X:
-    // Count the total # of txs in each bucket
-    // Track the historical moving average of this total over blocks
-    std::vector<double> txCtAvg;
-    // and calculate the total for the current block to update the moving average
-    std::vector<int> curBlockTxCt;
-
-    // Count the total # of txs confirmed within Y blocks in each bucket
-    // Track the historical moving average of these totals over blocks
-    std::vector<std::vector<double> > confAvg; // confAvg[Y][X]
-    // and calculate the totals for the current block to update the moving averages
-    std::vector<std::vector<int> > curBlockConf; // curBlockConf[Y][X]
-
-    // Sum the total feerate of all tx's in each bucket
-    // Track the historical moving average of this total over blocks
-    std::vector<double> avg;
-    // and calculate the total for the current block to update the moving average
-    std::vector<double> curBlockVal;
-
-    // Combine the conf counts with tx counts to calculate the confirmation % for each Y,X
-    // Combine the total value with the tx counts to calculate the avg feerate per bucket
-
-    double decay = DEFAULT_DECAY;
-
-    // Mempool counts of outstanding transactions
-    // For each bucket X, track the number of transactions in the mempool
-    // that are unconfirmed for each possible confirmation value Y
-    std::vector<std::vector<int> > unconfTxs;  //unconfTxs[Y][X]
-    // transactions still unconfirmed after MAX_CONFIRMS for each bucket
-    std::vector<int> oldUnconfTxs;
-
-public:
-    /** Find the bucket index of a given value */
-    unsigned int FindBucketIndex(double val);
-
-    /**
-     * Initialize the data structures.  This is called by BlockPolicyEstimator's
-     * constructor with default values.  A final bucket is created implicitly for
-     * values greater than the last upper limit in defaultBuckets.
-     *
-     * @param defaultBuckets contains the upper limits for the bucket boundaries
-     * @param maxConfirms max number of confirms to track
-     * @param decay how much to decay the historical moving average per block
-     */
-    void Initialize(std::vector<double>& defaultBuckets, unsigned int maxConfirms, double decay);
-
-    /** Clear the state of the curBlock variables to start counting for the new block */
-    void ClearCurrent(unsigned int nBlockHeight);
-
-    /**
-     * Record a new transaction data point in the current block stats
-     * @param blocksToConfirm the number of blocks it took this transaction to confirm
-     * @param val the feerate of the transaction
-     * @warning blocksToConfirm is 1-based and has to be >= 1
-     */
-    void Record(int blocksToConfirm, double val);
-
-    /** Record a new transaction entering the mempool*/
-    unsigned int NewTx(unsigned int nBlockHeight, double val);
-
-    /** Remove a transaction from mempool tracking stats*/
-    void removeTx(unsigned int entryHeight, unsigned int nBestSeenHeight,
-                  unsigned int bucketIndex);
-
-    /** Update our estimates by decaying our historical moving average and updating
-        with the data gathered from the current block */
-    void UpdateMovingAverages();
-
-    /**
-     * Calculate a feerate estimate.  Find the lowest value bucket (or range of buckets
-     * to make sure we have enough data points) whose transactions still have sufficient likelihood
-     * of being confirmed within the target number of confirmations
-     * @param confTarget target number of confirmations
-     * @param sufficientTxVal required average number of transactions per block in a bucket range
-     * @param minSuccess the success probability we require
-     * @param requireGreater return the lowest feerate such that all higher values pass minSuccess OR
-     *        return the highest feerate such that all lower values fail minSuccess
-     * @param nBlockHeight the current block height
-     */
-    double EstimateMedianVal(int confTarget, double sufficientTxVal,
-                             double minSuccess, bool requireGreater, unsigned int nBlockHeight);
-
-    /** Return the max number of confirms we're tracking */
-    unsigned int GetMaxConfirms() { return confAvg.size(); }
-
-    /** Write state of estimation data to a file*/
-    void Write(CAutoFile& fileout);
-
-    /**
-     * Read saved state of estimation data from a file and replace all internal data structures and
-     * variables with this state.
-     */
-    void Read(CAutoFile& filein);
-};
-
-
-
-/** Track confirm delays up to 25 blocks, can't estimate beyond that */
-static const unsigned int MAX_BLOCK_CONFIRMS = 25;
-
-/** Require greater than 85% of X feerate transactions to be confirmed within Y blocks for X to be big enough */
-static const double MIN_SUCCESS_PCT = .85;
-static const double UNLIKELY_PCT = .5;
-
-/** Require an avg of 1 tx in the combined feerate bucket per block to have stat significance */
-static const double SUFFICIENT_FEETXS = 1;
-
-// Minimum and Maximum values for tracking feerates
-static const double MIN_FEERATE = 10;
-static const double MAX_FEERATE = 1e7;
-static const double INF_FEERATE = MAX_MONEY;
-
-// We have to lump transactions into buckets based on feerate, but we want to be able
-// to give accurate estimates over a large range of potential feerates
-// Therefore it makes sense to exponentially space the buckets
-/** Spacing of FeeRate buckets */
-static const double FEE_SPACING = 1.1;
-
-/**
- *  We want to be able to estimate feerates that are needed on tx's to be included in
- * a certain number of blocks.  Every time a block is added to the best chain, this class records
- * stats on the transactions included in that block
- */
-class CBlockPolicyEstimator
-{
-public:
-    /** Create new BlockPolicyEstimator and initialize stats tracking classes with default values */
-    CBlockPolicyEstimator(const CFeeRate& minRelayFee);
-
-    /** Process all the transactions that have been included in a block */
-    void processBlock(unsigned int nBlockHeight,
-                      std::vector<CTxMemPoolEntry>& entries, bool fCurrentEstimate);
-
-    /** Process a transaction confirmed in a block*/
-    void processBlockTx(unsigned int nBlockHeight, const CTxMemPoolEntry& entry);
-
-    /** Process a transaction accepted to the mempool*/
-    void processTransaction(const CTxMemPoolEntry& entry, bool fCurrentEstimate);
-
-    /** Remove a transaction from the mempool tracking stats*/
-    void removeTx(uint256 hash);
-
-    /** Return a feerate estimate */
-    CFeeRate estimateFee(int confTarget);
-
-    /** Write estimation data to a file */
-    void Write(CAutoFile& fileout);
-
-    /** Read estimation data from a file */
-    void Read(CAutoFile& filein, int nFileVersion);
-
-private:
-    CFeeRate minTrackedFee;    //!< Passed to constructor to avoid dependency on main
-    unsigned int nBestSeenHeight;
-    struct TxStatsInfo
-    {
-        unsigned int blockHeight;
-        unsigned int bucketIndex;
-        TxStatsInfo() : blockHeight(0), bucketIndex(0) {}
-    };
-
-    // map of txids to information about that transaction
-    std::map<uint256, TxStatsInfo> mapMemPoolTxs;
-
-    /** Classes to track historical data on transaction confirmations */
-    TxConfirmStats feeStats;
-};
-#endif // BITCOIN_POLICY_FEES_H
diff --git a/src/policy/policy.h b/src/policy/policy.h
index 2bf61c915e9..9b988db1d27 100644
--- a/src/policy/policy.h
+++ b/src/policy/policy.h
@@ -67,8 +67,8 @@ static const unsigned int STANDARD_NOT_MANDATORY_VERIFY_FLAGS = STANDARD_SCRIPT_
  * zcashd v1.0.7-1 (#2141). The relaying problem for shielded transactions (#1969)
  * that prompted the latter change was fixed more thoroughly by the addition of
  * `CFeeRate::GetFeeForRelay` in #4916, ensuring that a transaction paying
- * `DEFAULT_FEE` can always be relayed. At the same time the default fee was set
- * to 1000 zats, per ZIP 313.
+ * `LEGACY_DEFAULT_FEE` can always be relayed. At the same time the default fee was
+ * set to 1000 zats, per ZIP 313.
  *
  * #6542 changed relaying policy to be more strict about enforcing minRelayTxFee.
  * It also allowed `-minrelaytxfee=0`, which we are using to avoid some test
diff --git a/src/rpc/client.cpp b/src/rpc/client.cpp
index 43edc29f2b0..04ca6a50771 100644
--- a/src/rpc/client.cpp
+++ b/src/rpc/client.cpp
@@ -57,7 +57,6 @@ static const CRPCConvertTable rpcCvtTable =
     // NB: The second argument _should_ be an object, but upstream treats it as a string, so we
     //     preserve that here.
     { "submitblock",                 {{s}, {s}} },
-    { "estimatefee",                 {{o}, {}} },
     { "getblocksubsidy",             {{o}, {}} },
     // misc
     { "getinfo",                     {{}, {}} },
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp
index 5209b9281d0..fa06974d769 100644
--- a/src/rpc/mining.cpp
+++ b/src/rpc/mining.cpp
@@ -910,38 +910,6 @@ UniValue submitblock(const UniValue& params, bool fHelp)
     return BIP22ValidationResult(state);
 }
 
-UniValue estimatefee(const UniValue& params, bool fHelp)
-{
-    if (fHelp || params.size() != 1)
-        throw runtime_error(
-            "estimatefee nblocks\n"
-            "\nEstimates the approximate fee per kilobyte\n"
-            "needed for a transaction to begin confirmation\n"
-            "within nblocks blocks.\n"
-            "\nArguments:\n"
-            "1. nblocks     (numeric)\n"
-            "\nResult:\n"
-            "n :    (numeric) estimated fee-per-kilobyte\n"
-            "\n"
-            "-1.0 is returned if not enough transactions and\n"
-            "blocks have been observed to make an estimate.\n"
-            "\nExample:\n"
-            + HelpExampleCli("estimatefee", "6")
-            );
-
-    RPCTypeCheck(params, boost::assign::list_of(UniValue::VNUM));
-
-    int nBlocks = params[0].get_int();
-    if (nBlocks < 1)
-        nBlocks = 1;
-
-    CFeeRate feeRate = mempool.estimateFee(nBlocks);
-    if (feeRate == CFeeRate(0))
-        return -1.0;
-
-    return ValueFromAmount(feeRate.GetFeePerK());
-}
-
 UniValue getblocksubsidy(const UniValue& params, bool fHelp)
 {
     if (fHelp || params.size() > 1)
@@ -1046,8 +1014,6 @@ static const CRPCCommand commands[] =
     { "generating",         "setgenerate",            &setgenerate,            true  },
     { "generating",         "generate",               &generate,               true  },
 #endif
-
-    { "util",               "estimatefee",            &estimatefee,            true  },
 };
 
 void RegisterMiningRPCCommands(CRPCTable &tableRPC)
diff --git a/src/transaction_builder.h b/src/transaction_builder.h
index 6aaa64f0aa6..05cc88aaf7b 100644
--- a/src/transaction_builder.h
+++ b/src/transaction_builder.h
@@ -8,7 +8,6 @@
 #include "coins.h"
 #include "consensus/params.h"
 #include "keystore.h"
-#include "policy/fees.h"
 #include "primitives/transaction.h"
 #include "random.h"
 #include "script/script.h"
@@ -262,7 +261,7 @@ class TransactionBuilder
     const CCoinsViewCache* coinsView;
     CCriticalSection* cs_coinsView;
     CMutableTransaction mtx;
-    CAmount fee = DEFAULT_FEE;
+    CAmount fee = LEGACY_DEFAULT_FEE;
     std::optional<uint256> orchardAnchor;
     std::optional<orchard::Builder> orchardBuilder;
     CAmount valueBalanceOrchard = 0;
diff --git a/src/txmempool.cpp b/src/txmempool.cpp
index 39491ac030d..a7d1c380966 100644
--- a/src/txmempool.cpp
+++ b/src/txmempool.cpp
@@ -10,7 +10,6 @@
 #include "consensus/consensus.h"
 #include "consensus/validation.h"
 #include "main.h"
-#include "policy/fees.h"
 #include "streams.h"
 #include "timedata.h"
 #include "util/system.h"
@@ -342,13 +341,11 @@ CTxMemPool::CTxMemPool(const CFeeRate& _minReasonableRelayFee) :
     // of transactions in the pool
     nCheckFrequency = 0;
 
-    minerPolicyEstimator = new CBlockPolicyEstimator(_minReasonableRelayFee);
     minReasonableRelayFee = _minReasonableRelayFee;
 }
 
 CTxMemPool::~CTxMemPool()
 {
-    delete minerPolicyEstimator;
     delete recentlyEvicted;
     delete limitSet;
 }
@@ -378,7 +375,7 @@ void CTxMemPool::AddTransactionsUpdated(unsigned int n)
     nTransactionsUpdated += n;
 }
 
-bool CTxMemPool::addUnchecked(const uint256& hash, const CTxMemPoolEntry &entry, setEntries &setAncestors, bool fCurrentEstimate)
+bool CTxMemPool::addUnchecked(const uint256& hash, const CTxMemPoolEntry &entry, setEntries &setAncestors)
 {
     // Add to memory pool without checking anything.
     // Used by main.cpp AcceptToMemoryPool(), which DOES do
@@ -443,7 +440,6 @@ bool CTxMemPool::addUnchecked(const uint256& hash, const CTxMemPoolEntry &entry,
 
     nTransactionsUpdated++;
     totalTxSize += entry.GetTxSize();
-    minerPolicyEstimator->processTransaction(entry, fCurrentEstimate);
 
     return true;
 }
@@ -579,7 +575,6 @@ void CTxMemPool::removeUnchecked(txiter it)
     mapLinks.erase(it);
     mapTx.erase(it);
     nTransactionsUpdated++;
-    minerPolicyEstimator->removeTx(hash);
 
     // insightexplorer
     if (fAddressIndex)
@@ -806,10 +801,10 @@ std::vector<uint256> CTxMemPool::removeExpired(unsigned int nBlockHeight)
 }
 
 /**
- * Called when a block is connected. Removes from mempool and updates the miner fee estimator.
+ * Called when a block is connected. Removes from mempool.
  */
 void CTxMemPool::removeForBlock(const std::vector<CTransaction>& vtx, unsigned int nBlockHeight,
-                                std::list<CTransaction>& conflicts, bool fCurrentEstimate)
+                                std::list<CTransaction>& conflicts)
 {
     LOCK(cs);
     std::vector<CTxMemPoolEntry> entries;
@@ -828,8 +823,6 @@ void CTxMemPool::removeForBlock(const std::vector<CTransaction>& vtx, unsigned i
         removeConflicts(tx, conflicts);
         ClearPrioritisation(tx.GetHash());
     }
-    // After the txs in the new block have been removed from the mempool, update policy estimates
-    minerPolicyEstimator->processBlock(nBlockHeight, entries, fCurrentEstimate);
 }
 
 /**
@@ -1103,46 +1096,6 @@ TxMempoolInfo CTxMemPool::info(const uint256& hash) const
     return TxMempoolInfo{i->GetSharedTx(), i->GetTime(), CFeeRate(i->GetFee(), i->GetTxSize())};
 }
 
-CFeeRate CTxMemPool::estimateFee(int nBlocks) const
-{
-    LOCK(cs);
-    return minerPolicyEstimator->estimateFee(nBlocks);
-}
-
-bool
-CTxMemPool::WriteFeeEstimates(CAutoFile& fileout) const
-{
-    try {
-        LOCK(cs);
-        fileout << FEE_ESTIMATES_WITHOUT_PRIORITY_VERSION; // version required to read
-        fileout << std::max(FEE_ESTIMATES_WITHOUT_PRIORITY_VERSION, 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 > std::max(FEE_ESTIMATES_WITHOUT_PRIORITY_VERSION, CLIENT_VERSION))
-            return error("CTxMemPool::ReadFeeEstimates(): up-version (%d) fee estimate file", nVersionRequired);
-        LOCK(cs);
-        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 std::string strHash, const CAmount& nFeeDelta)
 {
     {
@@ -1324,14 +1277,14 @@ void CTxMemPool::RemoveStaged(setEntries &stage) {
     }
 }
 
-bool CTxMemPool::addUnchecked(const uint256&hash, const CTxMemPoolEntry &entry, bool fCurrentEstimate)
+bool CTxMemPool::addUnchecked(const uint256&hash, const CTxMemPoolEntry &entry)
 {
     LOCK(cs);
     setEntries setAncestors;
     uint64_t nNoLimit = std::numeric_limits<uint64_t>::max();
     std::string dummy;
     CalculateMemPoolAncestors(entry, setAncestors, nNoLimit, nNoLimit, nNoLimit, nNoLimit, dummy);
-    return addUnchecked(hash, entry, setAncestors, fCurrentEstimate);
+    return addUnchecked(hash, entry, setAncestors);
 }
 
 void CTxMemPool::UpdateChild(txiter entry, txiter child, bool add)
diff --git a/src/txmempool.h b/src/txmempool.h
index 9ddea3d31c4..8e95dc84134 100644
--- a/src/txmempool.h
+++ b/src/txmempool.h
@@ -30,9 +30,6 @@
 
 class CAutoFile;
 
-/** Version from which we write `fee_estimates.dat` without priority information: 5.5.0-beta1 or later */
-static const int FEE_ESTIMATES_WITHOUT_PRIORITY_VERSION = 5050000;
-
 /** Fake height value used in CCoins to signify they are only in the memory pool (since 0.8) */
 static const unsigned int MEMPOOL_HEIGHT = 0x7FFFFFFF;
 
@@ -237,8 +234,6 @@ class CompareTxMemPoolEntryByEntryTime
 struct descendant_score {};
 struct mining_score {};
 
-class CBlockPolicyEstimator;
-
 /** An inpoint - a combination of a transaction and an index n into its vin */
 class CInPoint
 {
@@ -349,7 +344,6 @@ class CTxMemPool
 private:
     uint32_t nCheckFrequency; //!< Value n means that n times in 2^32 we check.
     unsigned int nTransactionsUpdated;
-    CBlockPolicyEstimator* minerPolicyEstimator;
 
     uint64_t totalTxSize = 0;  //!< sum of all mempool tx' byte sizes
     uint64_t cachedInnerUsage; //!< sum of dynamic memory usage of all the map elements (NOT the maps themselves)
@@ -487,8 +481,8 @@ class CTxMemPool
     // to track size/count of descendant transactions.  First version of
     // addUnchecked can be used to have it call CalculateMemPoolAncestors(), and
     // then invoke the second version.
-    bool addUnchecked(const uint256& hash, const CTxMemPoolEntry &entry, bool fCurrentEstimate = true);
-    bool addUnchecked(const uint256& hash, const CTxMemPoolEntry &entry, setEntries &setAncestors, bool fCurrentEstimate = true);
+    bool addUnchecked(const uint256& hash, const CTxMemPoolEntry &entry);
+    bool addUnchecked(const uint256& hash, const CTxMemPoolEntry &entry, setEntries &setAncestors);
 
     // START insightexplorer
     void addAddressIndex(const CTxMemPoolEntry &entry, const CCoinsViewCache &view);
@@ -507,7 +501,7 @@ class CTxMemPool
     void removeConflicts(const CTransaction &tx, std::list<CTransaction>& removed);
     std::vector<uint256> removeExpired(unsigned int nBlockHeight);
     void removeForBlock(const std::vector<CTransaction>& vtx, unsigned int nBlockHeight,
-                        std::list<CTransaction>& conflicts, bool fCurrentEstimate = true);
+                        std::list<CTransaction>& conflicts);
     void removeWithoutBranchId(uint32_t nMemPoolBranchId);
     void clear();
     void _clear(); // unlocked
@@ -584,13 +578,6 @@ class CTxMemPool
     TxMempoolInfo info(const uint256& hash) const;
     std::vector<TxMempoolInfo> infoAll() const;
 
-    /** Estimate fee rate needed to get into the next nBlocks */
-    CFeeRate estimateFee(int nBlocks) const;
-
-    /** Write/Read estimates to disk */
-    bool WriteFeeEstimates(CAutoFile& fileout) const;
-    bool ReadFeeEstimates(CAutoFile& filein);
-
     size_t DynamicMemoryUsage() const;
 
     /** Return nCheckFrequency */
diff --git a/src/wallet/asyncrpcoperation_saplingmigration.cpp b/src/wallet/asyncrpcoperation_saplingmigration.cpp
index 85abdf4c022..8e18dee6885 100644
--- a/src/wallet/asyncrpcoperation_saplingmigration.cpp
+++ b/src/wallet/asyncrpcoperation_saplingmigration.cpp
@@ -114,7 +114,7 @@ bool AsyncRPCOperation_saplingmigration::main_impl() {
         CAmount amountToSend = chooseAmount(availableFunds);
         auto builder = TransactionBuilder(consensusParams, targetHeight_, std::nullopt, pwalletMain, &coinsView, &cs_main);
         builder.SetExpiryHeight(targetHeight_ + MIGRATION_EXPIRY_DELTA);
-        LogPrint("zrpcunsafe", "%s: Beginning creating transaction with Sapling output amount=%s\n", getId(), FormatMoney(amountToSend - DEFAULT_FEE));
+        LogPrint("zrpcunsafe", "%s: Beginning creating transaction with Sapling output amount=%s\n", getId(), FormatMoney(amountToSend - LEGACY_DEFAULT_FEE));
         std::vector<SproutNoteEntry> fromNotes;
         CAmount fromNoteAmount = 0;
         while (fromNoteAmount < amountToSend) {
@@ -155,8 +155,8 @@ bool AsyncRPCOperation_saplingmigration::main_impl() {
         assert(changeAddr.has_value());
         // The amount chosen *includes* the default fee for this transaction, i.e.
         // the value of the Sapling output will be 0.00001 ZEC less.
-        builder.SetFee(DEFAULT_FEE);
-        builder.AddSaplingOutput(ovkForShieldingFromTaddr(seed), migrationDestAddress, amountToSend - DEFAULT_FEE);
+        builder.SetFee(LEGACY_DEFAULT_FEE);
+        builder.AddSaplingOutput(ovkForShieldingFromTaddr(seed), migrationDestAddress, amountToSend - LEGACY_DEFAULT_FEE);
         builder.SendChangeToSprout(changeAddr.value());
         CTransaction tx = builder.Build().GetTxOrThrow();
         if (isCancelled()) {
@@ -166,7 +166,7 @@ bool AsyncRPCOperation_saplingmigration::main_impl() {
         pwalletMain->AddPendingSaplingMigrationTx(tx);
         LogPrint("zrpcunsafe", "%s: Added pending migration transaction with txid=%s\n", getId(), tx.GetHash().ToString());
         ++numTxCreated;
-        amountMigrated += amountToSend - DEFAULT_FEE;
+        amountMigrated += amountToSend - LEGACY_DEFAULT_FEE;
         migrationTxIds.push_back(tx.GetHash().ToString());
     } while (numTxCreated < 5 && availableFunds > CENT);
 
diff --git a/src/wallet/rpcwallet.h b/src/wallet/rpcwallet.h
index 44c9d69ead5..22a7c9408a5 100644
--- a/src/wallet/rpcwallet.h
+++ b/src/wallet/rpcwallet.h
@@ -6,8 +6,6 @@
 #ifndef BITCOIN_WALLET_RPCWALLET_H
 #define BITCOIN_WALLET_RPCWALLET_H
 
-#include "policy/fees.h"  // for DEFAULT_FEE
-
 class CRPCTable;
 
 void RegisterWalletRPCCommands(CRPCTable &tableRPC);
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h
index d371eeca6d4..1c67a3bdfe3 100644
--- a/src/wallet/wallet.h
+++ b/src/wallet/wallet.h
@@ -1951,7 +1951,7 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
     static CAmount ConstrainFee(CAmount requestedFee, unsigned int nTxBytes);
 
     /**
-     * Estimate the minimum fee considering user set parameters
+     * Decide on the minimum fee considering user set parameters
      * and the required fee.
      */
     static CAmount GetMinimumFee(const CTransaction& tx, unsigned int nTxBytes);


Test patch:
diff --git a/qa/pull-tester/rpc-tests.py b/qa/pull-tester/rpc-tests.py
index 08e69880714..b68813e42d8 100755
--- a/qa/pull-tester/rpc-tests.py
+++ b/qa/pull-tester/rpc-tests.py
@@ -157,8 +157,6 @@
     # These tests are not run by the travis build process.
     # Longest test should go first, to favor running tests in parallel
     'pruning.py',
-    # vv Tests less than 20m vv
-    'smartfees.py',
     # vv Tests less than 5m vv
     # vv Tests less than 2m vv
     'getblocktemplate_longpoll.py',
diff --git a/qa/rpc-tests/feature_zip239.py b/qa/rpc-tests/feature_zip239.py
index 1e93cb95c10..dbb13e5133a 100755
--- a/qa/rpc-tests/feature_zip239.py
+++ b/qa/rpc-tests/feature_zip239.py
@@ -21,7 +21,7 @@
     HEARTWOOD_BRANCH_ID,
     CANOPY_BRANCH_ID,
     NU5_BRANCH_ID,
-    DEFAULT_FEE,
+    LEGACY_DEFAULT_FEE,
     assert_equal,
     assert_false,
     assert_true,
@@ -201,7 +201,7 @@ def run_test(self):
         opid = self.nodes[0].z_sendmany(sproutzaddr, [{
             'address': node1_taddr,
             'amount': 1,
-        }], 1, DEFAULT_FEE, 'AllowRevealedRecipients')
+        }], 1, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients')
         v4_txid = uint256_from_str(hex_str_to_bytes(
             wait_and_assert_operationid_status(self.nodes[0], opid)
         )[::-1])
diff --git a/qa/rpc-tests/getblocktemplate.py b/qa/rpc-tests/getblocktemplate.py
index 660b4efd3a0..fc67fec5566 100755
--- a/qa/rpc-tests/getblocktemplate.py
+++ b/qa/rpc-tests/getblocktemplate.py
@@ -9,7 +9,7 @@
 from test_framework.util import (
     assert_equal,
     CANOPY_BRANCH_ID,
-    DEFAULT_FEE,
+    LEGACY_DEFAULT_FEE,
     NU5_BRANCH_ID,
     get_coinbase_address,
     hex_str_to_bytes,
@@ -52,13 +52,13 @@ def add_nu5_v4_tx_to_mempool(self):
         node = self.node
         # sprout to transparent (v4)
         recipients = [{"address": self.transparent_addr, "amount": Decimal('0.1')}]
-        myopid = node.z_sendmany(self.sprout_addr, recipients, 1, DEFAULT_FEE, 'AllowRevealedRecipients')
+        myopid = node.z_sendmany(self.sprout_addr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients')
         wait_and_assert_operationid_status(node, myopid)
 
     def add_nu5_v5_tx_to_mempool(self):
         node = self.node
         recipients = [{"address": self.unified_addr, "amount": Decimal('9.99999')}]
-        myopid = node.z_sendmany(get_coinbase_address(node), recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
+        myopid = node.z_sendmany(get_coinbase_address(node), recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
         wait_and_assert_operationid_status(node, myopid)
 
     def add_transparent_tx_to_mempool(self):
diff --git a/qa/rpc-tests/mempool_resurrect_test.py b/qa/rpc-tests/mempool_resurrect_test.py
index 36012974ec1..1d317501818 100755
--- a/qa/rpc-tests/mempool_resurrect_test.py
+++ b/qa/rpc-tests/mempool_resurrect_test.py
@@ -10,7 +10,7 @@
 #
 
 from test_framework.test_framework import BitcoinTestFramework
-from test_framework.util import assert_equal, start_node, DEFAULT_FEE
+from test_framework.util import assert_equal, start_node, LEGACY_DEFAULT_FEE
 
 from decimal import Decimal
 
@@ -62,7 +62,7 @@ def run_test(self):
         blocks = []
         blocks.extend(self.nodes[0].generate(1))
 
-        spends2_raw = [ self.create_tx(txid, node0_address, Decimal('10.0') - DEFAULT_FEE) for txid in spends1_id ]
+        spends2_raw = [ self.create_tx(txid, node0_address, Decimal('10.0') - LEGACY_DEFAULT_FEE) for txid in spends1_id ]
         spends2_id = [ self.nodes[0].sendrawtransaction(tx) for tx in spends2_raw ]
 
         blocks.extend(self.nodes[0].generate(1))
diff --git a/qa/rpc-tests/mempool_tx_expiry.py b/qa/rpc-tests/mempool_tx_expiry.py
index 16c128a9848..9359ded5193 100755
--- a/qa/rpc-tests/mempool_tx_expiry.py
+++ b/qa/rpc-tests/mempool_tx_expiry.py
@@ -11,7 +11,7 @@
 from test_framework.test_framework import BitcoinTestFramework
 from test_framework.util import assert_equal, \
     connect_nodes_bi, sync_blocks, start_nodes, \
-    wait_and_assert_operationid_status, DEFAULT_FEE
+    wait_and_assert_operationid_status, LEGACY_DEFAULT_FEE
 from test_framework.zip317 import conventional_fee
 
 from decimal import Decimal
@@ -79,7 +79,7 @@ def run_test(self):
         assert_equal(set(self.nodes[2].getrawmempool()), set())
 
         ## Shield one of Alice's coinbase funds to her zaddr
-        res = self.nodes[0].z_shieldcoinbase("*", z_alice, DEFAULT_FEE, 1)
+        res = self.nodes[0].z_shieldcoinbase("*", z_alice, LEGACY_DEFAULT_FEE, 1)
         wait_and_assert_operationid_status(self.nodes[0], res['opid'])
         self.nodes[0].generate(1)
         self.sync_all()
@@ -87,7 +87,7 @@ def run_test(self):
         # Get balance on node 0
         bal = self.nodes[0].z_gettotalbalance()
         print("Balance before zsend, after shielding 10: ", bal)
-        assert_equal(Decimal(bal["private"]), Decimal('10.0') - DEFAULT_FEE)
+        assert_equal(Decimal(bal["private"]), Decimal('10.0') - LEGACY_DEFAULT_FEE)
 
         print("Splitting network...")
         self.split_network()
@@ -220,7 +220,7 @@ def run_test(self):
         print("Ensure balance of node 0 is correct")
         bal = self.nodes[0].z_gettotalbalance()
         print("Balance after expire_shielded has expired: ", bal)
-        assert_equal(Decimal(bal["private"]), Decimal('8.0') - DEFAULT_FEE)
+        assert_equal(Decimal(bal["private"]), Decimal('8.0') - LEGACY_DEFAULT_FEE)
 
         print("Splitting network...")
         self.split_network()
diff --git a/qa/rpc-tests/mergetoaddress_helper.py b/qa/rpc-tests/mergetoaddress_helper.py
index 7d1bb61e7ae..09c9eca44c6 100755
--- a/qa/rpc-tests/mergetoaddress_helper.py
+++ b/qa/rpc-tests/mergetoaddress_helper.py
@@ -10,7 +10,7 @@
 from test_framework.authproxy import JSONRPCException
 from test_framework.util import assert_equal, connect_nodes_bi, fail, \
     initialize_chain_clean, start_node, \
-    wait_and_assert_operationid_status, DEFAULT_FEE
+    wait_and_assert_operationid_status, LEGACY_DEFAULT_FEE
 from test_framework.zip317 import conventional_fee
 
 from decimal import Decimal
@@ -251,7 +251,7 @@ def generate_and_check(node, expected_transactions):
         test.sync_all()
 
         # This z_mergetoaddress and the one below result in two notes in myzaddr.
-        result = test.nodes[0].z_mergetoaddress([mytaddr], myzaddr, DEFAULT_FEE, None, None, None, 'AllowRevealedSenders')
+        result = test.nodes[0].z_mergetoaddress([mytaddr], myzaddr, LEGACY_DEFAULT_FEE, None, None, None, 'AllowRevealedSenders')
         assert_equal(result["mergingUTXOs"], 5)
         assert_equal(result["remainingUTXOs"], 0)
         assert_equal(result["mergingNotes"], 0)
@@ -259,7 +259,7 @@ def generate_and_check(node, expected_transactions):
         wait_and_assert_operationid_status(test.nodes[0], result['opid'])
 
         # Verify maximum number of UTXOs is not limited when the limit parameter is set to 0.
-        result = test.nodes[2].z_mergetoaddress([n2taddr], myzaddr, DEFAULT_FEE, 0, None, None, 'AllowRevealedSenders')
+        result = test.nodes[2].z_mergetoaddress([n2taddr], myzaddr, LEGACY_DEFAULT_FEE, 0, None, None, 'AllowRevealedSenders')
         assert_equal(result["mergingUTXOs"], 20)
         assert_equal(result["remainingUTXOs"], 0)
         assert_equal(result["mergingNotes"], 0)
@@ -303,7 +303,7 @@ def generate_and_check(node, expected_transactions):
         # NB: We can’t yet merge from UAs, so ensure we’re not before running these cases
         if (myzaddr[0] != 'u'):
             # Also check that we can set off a second merge before the first one is complete
-            result1 = test.nodes[0].z_mergetoaddress([myzaddr], myzaddr, DEFAULT_FEE, 50, 2)
+            result1 = test.nodes[0].z_mergetoaddress([myzaddr], myzaddr, LEGACY_DEFAULT_FEE, 50, 2)
 
             # First merge should select from all notes
             assert_equal(result1["mergingUTXOs"], 0)
@@ -313,7 +313,7 @@ def generate_and_check(node, expected_transactions):
             assert_equal(result1["remainingNotes"], 2)
 
             # Second merge should ignore locked notes
-            result2 = test.nodes[0].z_mergetoaddress([myzaddr], myzaddr, DEFAULT_FEE, 50, 2)
+            result2 = test.nodes[0].z_mergetoaddress([myzaddr], myzaddr, LEGACY_DEFAULT_FEE, 50, 2)
             assert_equal(result2["mergingUTXOs"], 0)
             assert_equal(result2["remainingUTXOs"], 0)
             assert_equal(result2["mergingNotes"], 2)
@@ -326,7 +326,7 @@ def generate_and_check(node, expected_transactions):
             test.sync_all()
 
             # Shield both UTXOs and notes to a z-addr
-            result = test.nodes[0].z_mergetoaddress(self.any_zaddr_or_utxo, myzaddr, DEFAULT_FEE, 10, 2, None, 'AllowRevealedSenders')
+            result = test.nodes[0].z_mergetoaddress(self.any_zaddr_or_utxo, myzaddr, LEGACY_DEFAULT_FEE, 10, 2, None, 'AllowRevealedSenders')
             assert_equal(result["mergingUTXOs"], 10)
             assert_equal(result["remainingUTXOs"], 7)
             assert_equal(result["mergingNotes"], 2)
@@ -334,7 +334,7 @@ def generate_and_check(node, expected_transactions):
             wait_and_assert_operationid_status(test.nodes[0], result['opid'])
         else:
             # Shield both UTXOs and notes to a z-addr
-            result = test.nodes[0].z_mergetoaddress(self.any_zaddr_or_utxo, myzaddr, DEFAULT_FEE, 10, 2, None, 'AllowRevealedSenders')
+            result = test.nodes[0].z_mergetoaddress(self.any_zaddr_or_utxo, myzaddr, LEGACY_DEFAULT_FEE, 10, 2, None, 'AllowRevealedSenders')
             assert_equal(result["mergingUTXOs"], 10)
             assert_equal(result["remainingUTXOs"], 7)
             assert_equal(result["mergingNotes"], 2)
diff --git a/qa/rpc-tests/regtest_signrawtransaction.py b/qa/rpc-tests/regtest_signrawtransaction.py
index 1d9a66131fc..df9512b330a 100755
--- a/qa/rpc-tests/regtest_signrawtransaction.py
+++ b/qa/rpc-tests/regtest_signrawtransaction.py
@@ -5,7 +5,7 @@
 
 from test_framework.test_framework import BitcoinTestFramework
 from test_framework.util import (
-    DEFAULT_FEE,
+    LEGACY_DEFAULT_FEE,
     start_nodes,
     wait_and_assert_operationid_status,
 )
@@ -33,7 +33,7 @@ def run_test(self):
         opid = self.nodes[1].z_sendmany(
             taddr,
             [{'address': zaddr1, 'amount': 1}],
-            1, DEFAULT_FEE, 'AllowFullyTransparent')
+            1, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent')
         wait_and_assert_operationid_status(self.nodes[1], opid)
 
 if __name__ == '__main__':
diff --git a/qa/rpc-tests/show_help.py b/qa/rpc-tests/show_help.py
index 9658fc77b0a..a0809e74b60 100755
--- a/qa/rpc-tests/show_help.py
+++ b/qa/rpc-tests/show_help.py
@@ -428,7 +428,7 @@
        Output debugging information (default: 0, supplying <category> is
        optional). If <category> is not supplied or if <category> = 1, output
        all debugging information. <category> can be: addrman, alert, bench,
-       coindb, db, estimatefee, http, libevent, lock, mempool, mempoolrej, net,
+       coindb, db, http, libevent, lock, mempool, mempoolrej, net,
        partitioncheck, pow, proxy, prune, rand, receiveunsafe, reindex, rpc,
        selectcoins, tor, zmq, zrpc, zrpcunsafe (implies zrpc). For multiple
        specific categories use -debug=<category> multiple times.
diff --git a/qa/rpc-tests/signrawtransaction_offline.py b/qa/rpc-tests/signrawtransaction_offline.py
index bd641d37123..8927c6eb7d5 100755
--- a/qa/rpc-tests/signrawtransaction_offline.py
+++ b/qa/rpc-tests/signrawtransaction_offline.py
@@ -3,7 +3,7 @@
 from test_framework.test_framework import BitcoinTestFramework
 from test_framework.util import (
     BLOSSOM_BRANCH_ID,
-    DEFAULT_FEE,
+    LEGACY_DEFAULT_FEE,
     assert_equal,
     assert_true,
     initialize_chain_clean,
@@ -49,7 +49,7 @@ def run_test(self):
         create_inputs = [{'txid': txid, 'vout': 0}]
         sign_inputs = [{'txid': txid, 'vout': 0, 'scriptPubKey': scriptpubkey, 'amount': 10}]
 
-        create_hex = self.nodes[0].createrawtransaction(create_inputs, {taddr: Decimal('10.0') - DEFAULT_FEE})
+        create_hex = self.nodes[0].createrawtransaction(create_inputs, {taddr: Decimal('10.0') - LEGACY_DEFAULT_FEE})
 
         # An offline regtest node does not rely on the approx release height of the software
         # to determine the consensus rules to be used for signing.
diff --git a/qa/rpc-tests/smartfees.py b/qa/rpc-tests/smartfees.py
deleted file mode 100755
index f2d00c4dd8a..00000000000
--- a/qa/rpc-tests/smartfees.py
+++ /dev/null
@@ -1,266 +0,0 @@
-#!/usr/bin/env python3
-# Copyright (c) 2014-2016 The Bitcoin Core developers
-# Copyright (c) 2017-2022 The Zcash developers
-# Distributed under the MIT software license, see the accompanying
-# file COPYING or https://www.opensource.org/licenses/mit-license.php .
-
-#
-# Test fee estimation code
-#
-
-from test_framework.test_framework import BitcoinTestFramework
-from test_framework.util import start_node, connect_nodes, \
-    sync_blocks, sync_mempools
-
-import random
-from decimal import Decimal, ROUND_DOWN
-
-# Construct 2 trivial P2SH's and the ScriptSigs that spend them
-# So we can create many transactions without needing to spend
-# time signing.
-P2SH_1 = "2MySexEGVzZpRgNQ1JdjdP5bRETznm3roQ2" # P2SH of "OP_1 OP_DROP"
-P2SH_2 = "2NBdpwq8Aoo1EEKEXPNrKvr5xQr3M9UfcZA" # P2SH of "OP_2 OP_DROP"
-# Associated ScriptSig's to spend satisfy P2SH_1 and P2SH_2
-# 4 bytes of OP_TRUE and push 2-byte redeem script of "OP_1 OP_DROP" or "OP_2 OP_DROP"
-SCRIPT_SIG = ["0451025175", "0451025275"]
-
-def satoshi_round(amount):
-    return  Decimal(amount).quantize(Decimal('0.00000001'), rounding=ROUND_DOWN)
-
-def small_txpuzzle_randfee(from_node, conflist, unconflist, amount, min_fee, fee_increment):
-    '''
-    Create and send a transaction with a random fee.
-    The transaction pays to a trivial P2SH script, and assumes that its inputs
-    are of the same form.
-    The function takes a list of confirmed outputs and unconfirmed outputs
-    and attempts to use the confirmed list first for its inputs.
-    It adds the newly created outputs to the unconfirmed list.
-    Returns (raw transaction, fee)
-    '''
-    # It's best to exponentially distribute our random fees
-    # because the buckets are exponentially spaced.
-    # Exponentially distributed from 1-128 * fee_increment
-    rand_fee = float(fee_increment)*(1.1892**random.randint(0,28))
-    # Total fee ranges from min_fee to min_fee + 127*fee_increment
-    fee = min_fee - fee_increment + satoshi_round(rand_fee)
-    inputs = []
-    total_in = Decimal("0.00000000")
-    while total_in <= (amount + fee) and len(conflist) > 0:
-        t = conflist.pop(0)
-        total_in += t["amount"]
-        inputs.append({ "txid" : t["txid"], "vout" : t["vout"]} )
-    if total_in <= amount + fee:
-        while total_in <= (amount + fee) and len(unconflist) > 0:
-            t = unconflist.pop(0)
-            total_in += t["amount"]
-            inputs.append({ "txid" : t["txid"], "vout" : t["vout"]} )
-        if total_in <= amount + fee:
-            raise RuntimeError("Insufficient funds: need %d, have %d"%(amount+fee, total_in))
-    outputs = {}
-    outputs[P2SH_1] = total_in - amount - fee
-    outputs[P2SH_2] = amount
-    rawtx = from_node.createrawtransaction(inputs, outputs)
-    # Createrawtransaction constructions a transaction that is ready to be signed
-    # These transactions don't need to be signed, but we still have to insert the ScriptSig
-    # that will satisfy the ScriptPubKey.
-    completetx = rawtx[0:10]
-    inputnum = 0
-    for inp in inputs:
-        completetx += rawtx[10+82*inputnum:82+82*inputnum]
-        completetx += SCRIPT_SIG[inp["vout"]]
-        completetx += rawtx[84+82*inputnum:92+82*inputnum]
-        inputnum += 1
-    completetx += rawtx[10+82*inputnum:]
-    txid = from_node.sendrawtransaction(completetx, True)
-    unconflist.append({ "txid" : txid, "vout" : 0 , "amount" : total_in - amount - fee})
-    unconflist.append({ "txid" : txid, "vout" : 1 , "amount" : amount})
-
-    return (completetx, fee)
-
-def split_inputs(from_node, txins, txouts, initial_split = False):
-    """
-    We need to generate a lot of inputs so we can generate a ton of transactions.
-    This function takes an input from txins, and creates and sends a transaction
-    which splits the value into 2 outputs which are appended to txouts.
-    Previously this was designed to be small inputs so they wouldn't have
-    a high coin age when the notion of priority still existed.
-    """
-    prevtxout = txins.pop()
-    inputs = []
-    outputs = {}
-    inputs.append({ "txid" : prevtxout["txid"], "vout" : prevtxout["vout"] })
-    half_change = satoshi_round(prevtxout["amount"]/2)
-    rem_change = prevtxout["amount"] - half_change  - Decimal("0.00001000")
-    outputs[P2SH_1] = half_change
-    outputs[P2SH_2] = rem_change
-    rawtx = from_node.createrawtransaction(inputs, outputs)
-    # If this is the initial split we actually need to sign the transaction
-    # Otherwise we just need to insert the property ScriptSig
-    if (initial_split) :
-        completetx = from_node.signrawtransaction(rawtx)["hex"]
-    else :
-        completetx = rawtx[0:82] + SCRIPT_SIG[prevtxout["vout"]] + rawtx[84:]
-    txid = from_node.sendrawtransaction(completetx, True)
-    txouts.append({ "txid" : txid, "vout" : 0 , "amount" : half_change})
-    txouts.append({ "txid" : txid, "vout" : 1 , "amount" : rem_change})
-
-def check_estimates(node, fees_seen, max_invalid, print_estimates = True):
-    '''
-    This function calls estimatefee and verifies that the estimates
-    meet certain invariants.
-    '''
-    all_estimates = [ node.estimatefee(i) for i in range(1,26) ]
-    if print_estimates:
-        print([str(all_estimates[e-1]) for e in [1,2,3,6,15,25]])
-    delta = 1.0e-6 # account for rounding error
-    last_e = max(fees_seen)
-    for e in [x for x in all_estimates if x >= 0]:
-        # Estimates should be within the bounds of what transactions fees actually were:
-        if float(e)+delta < min(fees_seen) or float(e)-delta > max(fees_seen):
-            raise AssertionError("Estimated fee (%f) out of range (%f,%f)"
-                                 %(float(e), min(fees_seen), max(fees_seen)))
-        # Estimates should be monotonically decreasing
-        if float(e)-delta > last_e:
-            raise AssertionError("Estimated fee (%f) larger than last fee (%f) for lower number of confirms"
-                                 %(float(e),float(last_e)))
-        last_e = e
-    valid_estimate = False
-    invalid_estimates = 0
-    for e in all_estimates:
-        if e >= 0:
-            valid_estimate = True
-        else:
-            invalid_estimates += 1
-        # Once we're at a high enough confirmation count that we can give an estimate
-        # We should have estimates for all higher confirmation counts
-        if valid_estimate and e < 0:
-            raise AssertionError("Invalid estimate appears at higher confirm count than valid estimate")
-    # Check on the expected number of different confirmation counts
-    # that we might not have valid estimates for
-    if invalid_estimates > max_invalid:
-        raise AssertionError("More than (%d) invalid estimates"%(max_invalid))
-    return all_estimates
-
-
-class EstimateFeeTest(BitcoinTestFramework):
-
-    def __init__(self):
-        super().__init__()
-        self.num_nodes = 3
-
-    def setup_network(self):
-        '''
-        We'll setup the network to have 3 nodes that all mine with different parameters.
-        But first we need to use one node to create a lot of outputs
-        which we will use to generate our transactions.
-        '''
-        self.nodes = []
-        # Use node0 to mine blocks for input splitting
-        self.nodes.append(start_node(0, self.options.tmpdir, ["-maxorphantx=1000",
-                                                              "-whitelist=127.0.0.1"]))
-
-        print("This test is time consuming, please be patient")
-        print("Splitting inputs so we can generate tx's")
-        self.txouts = []
-        self.txouts2 = []
-        # Split a coinbase into two transaction puzzle outputs
-        split_inputs(self.nodes[0], self.nodes[0].listunspent(0), self.txouts, True)
-
-        # Mine
-        while (len(self.nodes[0].getrawmempool()) > 0):
-            self.nodes[0].generate(1)
-
-        # Repeatedly split those 2 outputs, doubling twice for each rep
-        # Use txouts to monitor the available utxo, since these won't be tracked in wallet
-        reps = 0
-        while (reps < 5):
-            #Double txouts to txouts2
-            while (len(self.txouts)>0):
-                split_inputs(self.nodes[0], self.txouts, self.txouts2)
-            while (len(self.nodes[0].getrawmempool()) > 0):
-                self.nodes[0].generate(1)
-            #Double txouts2 to txouts
-            while (len(self.txouts2)>0):
-                split_inputs(self.nodes[0], self.txouts2, self.txouts)
-            while (len(self.nodes[0].getrawmempool()) > 0):
-                self.nodes[0].generate(1)
-            reps += 1
-        print("Finished splitting")
-
-        # Now we can connect the other nodes, didn't want to connect them earlier
-        # so the estimates would not be affected by the splitting transactions
-        # Node1 mines small blocks but that are bigger than the expected transaction rate.
-        # NOTE: the CreateNewBlock code starts counting block size at 1,000 bytes,
-        # (17k is room enough for 110 or so transactions)
-        self.nodes.append(start_node(1, self.options.tmpdir,
-                                     ["-blockmaxsize=18000", "-maxorphantx=1000", "-debug=estimatefee"]))
-        connect_nodes(self.nodes[1], 0)
-
-        # Node2 is a stingy miner, that
-        # produces too small blocks (room for only 70 or so transactions)
-        node2args = ["-blockmaxsize=12000", "-maxorphantx=1000"]
-
-        self.nodes.append(start_node(2, self.options.tmpdir, node2args))
-        connect_nodes(self.nodes[0], 2)
-        connect_nodes(self.nodes[2], 1)
-
-        self.is_network_split = False
-        self.sync_all()
-
-    def transact_and_mine(self, numblocks, mining_node):
-        min_fee = Decimal("0.00001")
-        # We will now mine numblocks blocks generating on average 100 transactions between each block
-        # We shuffle our confirmed txout set before each set of transactions
-        # small_txpuzzle_randfee will use the transactions that have inputs already in the chain when possible
-        # resorting to tx's that depend on the mempool when those run out
-        for i in range(numblocks):
-            random.shuffle(self.confutxo)
-            for j in range(random.randrange(100-50,100+50)):
-                from_index = random.randint(1,2)
-                (txhex, fee) = small_txpuzzle_randfee(self.nodes[from_index], self.confutxo,
-                                                      self.memutxo, Decimal("0.005"), min_fee, min_fee)
-                tx_kbytes = (len(txhex) // 2) / 1000.0
-                self.fees_per_kb.append(float(fee)/tx_kbytes)
-            sync_mempools(self.nodes[0:3],.1)
-            mined = mining_node.getblock(mining_node.generate(1)[0],True)["tx"]
-            sync_blocks(self.nodes[0:3],.1)
-            #update which txouts are confirmed
-            newmem = []
-            for utx in self.memutxo:
-                if utx["txid"] in mined:
-                    self.confutxo.append(utx)
-                else:
-                    newmem.append(utx)
-            self.memutxo = newmem
-
-    def run_test(self):
-        self.fees_per_kb = []
-        self.memutxo = []
-        self.confutxo = self.txouts # Start with the set of confirmed txouts after splitting
-        print("Checking estimates for 1/2/3/6/15/25 blocks")
-        print("Creating transactions and mining them with a huge block size")
-        # Create transactions and mine 20 big blocks with node 0 such that the mempool is always emptied
-        self.transact_and_mine(30, self.nodes[0])
-        check_estimates(self.nodes[1], self.fees_per_kb, 1)
-
-        print("Creating transactions and mining them with a block size that can't keep up")
-        # Create transactions and mine 30 small blocks with node 2, but create txs faster than we can mine
-        self.transact_and_mine(20, self.nodes[2])
-        check_estimates(self.nodes[1], self.fees_per_kb, 3)
-
-        print("Creating transactions and mining them at a block size that is just big enough")
-        # Generate transactions while mining 40 more blocks, this time with node1
-        # which mines blocks with capacity just above the rate that transactions are being created
-        self.transact_and_mine(40, self.nodes[1])
-        check_estimates(self.nodes[1], self.fees_per_kb, 2)
-
-        # Finish by mining a normal-sized block:
-        while len(self.nodes[1].getrawmempool()) > 0:
-            self.nodes[1].generate(1)
-
-        sync_blocks(self.nodes[0:3],.1)
-        print("Final estimates after emptying mempools")
-        check_estimates(self.nodes[1], self.fees_per_kb, 2)
-
-if __name__ == '__main__':
-    EstimateFeeTest().main()
diff --git a/qa/rpc-tests/sprout_sapling_migration.py b/qa/rpc-tests/sprout_sapling_migration.py
index 15084aaa3af..aee4370cb76 100755
--- a/qa/rpc-tests/sprout_sapling_migration.py
+++ b/qa/rpc-tests/sprout_sapling_migration.py
@@ -7,7 +7,7 @@
 from test_framework.test_framework import BitcoinTestFramework
 from test_framework.util import assert_equal, assert_true, \
     start_nodes, \
-    wait_and_assert_operationid_status_result, DEFAULT_FEE
+    wait_and_assert_operationid_status_result, LEGACY_DEFAULT_FEE
 
 SAPLING_ADDR = 'zregtestsapling1ssqj3f3majnl270985gqcdqedd9t4nlttjqskccwevj2v20sc25deqspv3masufnwcdy67cydyy'
 SAPLING_KEY = 'secret-extended-key-regtest1qv62zt2fqyqqpqrh2qzc08h7gncf4447jh9kvnnnhjg959fkwt7mhw9j8e9at7attx8z6u3953u86vcnsujdc2ckdlcmztjt44x3uxpah5mxtncxd0mqcnz9eq8rghh5m4j44ep5d9702sdvvwawqassulktfegrcp4twxgqdxx4eww3lau0mywuaeztpla2cmvagr5nj98elt45zh6fjznadl6wz52n2uyhdwcm2wlsu8fnxstrk6s4t55t8dy6jkgx5g0cwpchh5qffp8x5'
@@ -127,7 +127,7 @@ def run_migration_test(self, node, sproutAddr, saplingAddr, target_height, sprou
         # Check that unmigrated amount + unfinalized = starting balance - fee
         status = node.z_getmigrationstatus()
         print("status: {}".format(status))
-        assert_equal(sprout_initial_balance - DEFAULT_FEE, Decimal(status['unmigrated_amount']) + Decimal(status['unfinalized_migrated_amount']))
+        assert_equal(sprout_initial_balance - LEGACY_DEFAULT_FEE, Decimal(status['unmigrated_amount']) + Decimal(status['unfinalized_migrated_amount']))
 
         # The transaction in the mempool should be the one listed in migration_txids,
         # and it should expire at the next 450 % 500.
@@ -146,7 +146,7 @@ def run_migration_test(self, node, sproutAddr, saplingAddr, target_height, sprou
         print("sprout balance: {}, sapling balance: {}".format(sprout_balance, sapling_balance))
         assert_true(sprout_balance < sprout_initial_balance, "Should have less Sprout funds")
         assert_true(sapling_balance > Decimal('0'), "Should have more Sapling funds")
-        assert_true(sprout_balance + sapling_balance, sprout_initial_balance - DEFAULT_FEE)
+        assert_true(sprout_balance + sapling_balance, sprout_initial_balance - LEGACY_DEFAULT_FEE)
 
         check_migration_status(node, saplingAddr, DURING_MIGRATION)
         # At 10 % 500 the transactions will be considered 'finalized'
diff --git a/qa/rpc-tests/test_framework/util.py b/qa/rpc-tests/test_framework/util.py
index e741af8dbe8..b5c7622b113 100644
--- a/qa/rpc-tests/test_framework/util.py
+++ b/qa/rpc-tests/test_framework/util.py
@@ -31,8 +31,7 @@
 
 ZCASHD_BINARY = os.path.join('src', 'zcashd')
 
-DEFAULT_FEE = Decimal('0.00001')
-DEFAULT_FEE_ZATS = 1000
+LEGACY_DEFAULT_FEE = Decimal('0.00001')
 
 COVERAGE_DIR = None
 PRE_BLOSSOM_BLOCK_TARGET_SPACING = 150
@@ -315,7 +314,6 @@ def rebuild_cache():
             os.remove(node_file(cachedir, i, "debug.log"))
             os.remove(node_file(cachedir, i, "db.log"))
             os.remove(node_file(cachedir, i, "peers.dat"))
-            os.remove(node_file(cachedir, i, "fee_estimates.dat"))
 
     def init_from_cache():
         for i in range(num_nodes):
diff --git a/qa/rpc-tests/wallet_1941.py b/qa/rpc-tests/wallet_1941.py
index a3e44c4a1d8..d9bcb405f16 100755
--- a/qa/rpc-tests/wallet_1941.py
+++ b/qa/rpc-tests/wallet_1941.py
@@ -9,7 +9,7 @@
 from test_framework.util import assert_equal, initialize_chain_clean, \
     initialize_datadir, start_nodes, start_node, connect_nodes_bi, \
     bitcoind_processes, wait_and_assert_operationid_status, \
-    get_coinbase_address, DEFAULT_FEE
+    get_coinbase_address, LEGACY_DEFAULT_FEE
 
 from decimal import Decimal
 
@@ -68,8 +68,8 @@ def run_test (self):
 
         # Send 10 coins to our zaddr.
         recipients = []
-        recipients.append({"address":myzaddr, "amount":Decimal('10.0') - DEFAULT_FEE})
-        myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
+        recipients.append({"address":myzaddr, "amount":Decimal('10.0') - LEGACY_DEFAULT_FEE})
+        myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
         wait_and_assert_operationid_status(self.nodes[0], myopid)
         self.nodes[0].generate(1)
 
@@ -82,7 +82,7 @@ def run_test (self):
 
         # Confirm the balance on node 0.
         resp = self.nodes[0].z_getbalance(myzaddr)
-        assert_equal(Decimal(resp), Decimal('10.0') - DEFAULT_FEE)
+        assert_equal(Decimal(resp), Decimal('10.0') - LEGACY_DEFAULT_FEE)
 
         # Export the key for the zaddr from node 0.
         key = self.nodes[0].z_exportkey(myzaddr)
@@ -109,7 +109,7 @@ def run_test (self):
         # Confirm that the balance on node 1 is valid now (node 1 must
         # have rescanned)
         resp = self.nodes[1].z_getbalance(myzaddr)
-        assert_equal(Decimal(resp), Decimal('10.0') - DEFAULT_FEE)
+        assert_equal(Decimal(resp), Decimal('10.0') - LEGACY_DEFAULT_FEE)
 
 
 if __name__ == '__main__':
diff --git a/qa/rpc-tests/wallet_anchorfork.py b/qa/rpc-tests/wallet_anchorfork.py
index 7872f7a903c..d8bd8cda5e0 100755
--- a/qa/rpc-tests/wallet_anchorfork.py
+++ b/qa/rpc-tests/wallet_anchorfork.py
@@ -7,7 +7,7 @@
 from test_framework.util import assert_equal, initialize_chain_clean, \
     start_nodes, stop_nodes, connect_nodes_bi, \
     wait_and_assert_operationid_status, wait_bitcoinds, get_coinbase_address, \
-    sync_blocks, sync_mempools, DEFAULT_FEE
+    sync_blocks, sync_mempools, LEGACY_DEFAULT_FEE
 from decimal import Decimal
 
 class WalletAnchorForkTest (BitcoinTestFramework):
@@ -52,8 +52,8 @@ def run_test (self):
         mytaddr0 = get_coinbase_address(self.nodes[0])
         myzaddr0 = self.nodes[0].z_getnewaddress()
         recipients = []
-        recipients.append({"address":myzaddr0, "amount": Decimal('10.0') - DEFAULT_FEE})
-        myopid = self.nodes[0].z_sendmany(mytaddr0, recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
+        recipients.append({"address":myzaddr0, "amount": Decimal('10.0') - LEGACY_DEFAULT_FEE})
+        myopid = self.nodes[0].z_sendmany(mytaddr0, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
         wait_and_assert_operationid_status(self.nodes[0], myopid)
 
         # Sync up mempools and mine the transaction.  All nodes have the same anchor.
@@ -76,8 +76,8 @@ def run_test (self):
 
         # Partition A, node 0 creates a joinsplit transaction
         recipients = []
-        recipients.append({"address":myzaddr0, "amount": Decimal('10.0') - DEFAULT_FEE})
-        myopid = self.nodes[0].z_sendmany(mytaddr0, recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
+        recipients.append({"address":myzaddr0, "amount": Decimal('10.0') - LEGACY_DEFAULT_FEE})
+        myopid = self.nodes[0].z_sendmany(mytaddr0, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
         txid = wait_and_assert_operationid_status(self.nodes[0], myopid)
         rawhex = self.nodes[0].getrawtransaction(txid)
 
diff --git a/qa/rpc-tests/wallet_listnotes.py b/qa/rpc-tests/wallet_listnotes.py
index 065005bd996..aafd0cf26b9 100755
--- a/qa/rpc-tests/wallet_listnotes.py
+++ b/qa/rpc-tests/wallet_listnotes.py
@@ -12,7 +12,7 @@
     nuparams,
     start_nodes,
     wait_and_assert_operationid_status,
-    DEFAULT_FEE
+    LEGACY_DEFAULT_FEE
 )
 
 from decimal import Decimal
@@ -46,10 +46,10 @@ def run_test(self):
         # Send 1.0 minus default fee from sproutzaddr to a new Sapling zaddr
         saplingzaddr = self.nodes[0].z_getnewaddress('sapling')
         receive_amount_2 = Decimal('1.0')
-        change_amount_2 = receive_amount_1 - receive_amount_2 - DEFAULT_FEE
+        change_amount_2 = receive_amount_1 - receive_amount_2 - LEGACY_DEFAULT_FEE
         assert_equal('sapling', self.nodes[0].z_validateaddress(saplingzaddr)['address_type'])
         recipients = [{"address": saplingzaddr, "amount":receive_amount_2}]
-        myopid = self.nodes[0].z_sendmany(sproutzaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedAmounts')
+        myopid = self.nodes[0].z_sendmany(sproutzaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedAmounts')
         txid_2 = wait_and_assert_operationid_status(self.nodes[0], myopid)
         self.sync_all()
 
@@ -86,9 +86,9 @@ def run_test(self):
         # Send 2.0 minus default fee to a new sapling zaddr
         saplingzaddr2 = self.nodes[0].z_getnewaddress('sapling')
         receive_amount_3 = Decimal('2.0')
-        change_amount_3 = change_amount_2 - receive_amount_3 - DEFAULT_FEE
+        change_amount_3 = change_amount_2 - receive_amount_3 - LEGACY_DEFAULT_FEE
         recipients = [{"address": saplingzaddr2, "amount":receive_amount_3}]
-        myopid = self.nodes[0].z_sendmany(sproutzaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedAmounts')
+        myopid = self.nodes[0].z_sendmany(sproutzaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedAmounts')
         txid_3 = wait_and_assert_operationid_status(self.nodes[0], myopid)
         self.sync_all()
         unspent_tx = self.nodes[0].z_listunspent(0)
diff --git a/qa/rpc-tests/wallet_listreceived.py b/qa/rpc-tests/wallet_listreceived.py
index c39786b0ab5..2edb77fb475 100755
--- a/qa/rpc-tests/wallet_listreceived.py
+++ b/qa/rpc-tests/wallet_listreceived.py
@@ -12,7 +12,7 @@
     assert_raises_message,
     connect_nodes_bi,
     nuparams,
-    DEFAULT_FEE,
+    LEGACY_DEFAULT_FEE,
     NU5_BRANCH_ID,
 )
 from test_framework.util import wait_and_assert_operationid_status, start_nodes
@@ -66,7 +66,7 @@ def test_received_sapling(self, height):
         opid = self.nodes[1].z_sendmany(taddr, [
             {'address': zaddr1, 'amount': 1, 'memo': my_memo},
             {'address': zaddrExt, 'amount': 2},
-        ], 1, DEFAULT_FEE, 'AllowFullyTransparent')
+        ], 1, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent')
         txid = wait_and_assert_operationid_status(self.nodes[1], opid)
         self.sync_all()
 
@@ -179,7 +179,7 @@ def test_received_sapling(self, height):
         assert_equal(txid, r[0]['txid'])
         assert_equal(Decimal('0.4')-conventional_fee(2), r[0]['amount'])
         assert_equal(40000000-conventional_fee_zats(2), r[0]['amountZat'])
-        assert_equal(r[0]['change'], True, "Note valued at (0.4-"+str(DEFAULT_FEE)+") should be change")
+        assert_equal(r[0]['change'], True, "Note valued at (0.4-"+str(LEGACY_DEFAULT_FEE)+") should be change")
         assert_equal(no_memo, r[0]['memo'])
 
         # The old note still exists (it's immutable), even though it is spent
diff --git a/qa/rpc-tests/wallet_nullifiers.py b/qa/rpc-tests/wallet_nullifiers.py
index 1a16df9939b..3462517092a 100755
--- a/qa/rpc-tests/wallet_nullifiers.py
+++ b/qa/rpc-tests/wallet_nullifiers.py
@@ -6,7 +6,7 @@
 from test_framework.test_framework import BitcoinTestFramework
 from test_framework.util import assert_equal, assert_true, bitcoind_processes, \
     connect_nodes_bi, start_node, start_nodes, wait_and_assert_operationid_status, \
-    get_coinbase_address, DEFAULT_FEE
+    get_coinbase_address, LEGACY_DEFAULT_FEE
 from test_framework.zip317 import conventional_fee
 
 from decimal import Decimal
@@ -32,11 +32,11 @@ def run_test (self):
         # Tests using the default cached chain have one address per coinbase output
         mytaddr = get_coinbase_address(self.nodes[0])
         recipients = []
-        recipients.append({"address": myzaddr0, "amount": Decimal('10.0') - DEFAULT_FEE}) # utxo amount less fee
+        recipients.append({"address": myzaddr0, "amount": Decimal('10.0') - LEGACY_DEFAULT_FEE}) # utxo amount less fee
 
         wait_and_assert_operationid_status(
             self.nodes[0],
-            self.nodes[0].z_sendmany(mytaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders'),
+            self.nodes[0].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders'),
             timeout=120)
 
         self.sync_all()
@@ -109,7 +109,7 @@ def run_test (self):
 
         wait_and_assert_operationid_status(
             self.nodes[1],
-            self.nodes[1].z_sendmany(myzaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedRecipients'),
+            self.nodes[1].z_sendmany(myzaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients'),
             timeout=120)
 
         self.sync_all()
@@ -118,7 +118,7 @@ def run_test (self):
 
         # check zaddr balance
         zsendmany3notevalue = Decimal('1.0')
-        zaddrremaining2 = zaddrremaining - zsendmany3notevalue - DEFAULT_FEE
+        zaddrremaining2 = zaddrremaining - zsendmany3notevalue - LEGACY_DEFAULT_FEE
         assert_equal(self.nodes[1].z_getbalance(myzaddr), zaddrremaining2)
         assert_equal(self.nodes[2].z_getbalance(myzaddr), zaddrremaining2)
 
diff --git a/qa/rpc-tests/wallet_overwintertx.py b/qa/rpc-tests/wallet_overwintertx.py
index 4e4c3897f3c..c379bc265e2 100755
--- a/qa/rpc-tests/wallet_overwintertx.py
+++ b/qa/rpc-tests/wallet_overwintertx.py
@@ -11,7 +11,7 @@
     get_coinbase_address,
     start_nodes,
     wait_and_assert_operationid_status,
-    DEFAULT_FEE
+    LEGACY_DEFAULT_FEE
 )
 from test_framework.authproxy import JSONRPCException
 
@@ -70,12 +70,12 @@ def run_test (self):
         # Node 2 sends the zero-confirmation transparent funds to Node 1 using z_sendmany
         recipients = []
         recipients.append({"address":taddr1, "amount": Decimal('0.5')})
-        myopid = self.nodes[2].z_sendmany(taddr2, recipients, 0, DEFAULT_FEE, 'AllowFullyTransparent')
+        myopid = self.nodes[2].z_sendmany(taddr2, recipients, 0, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent')
         txid_zsendmany = wait_and_assert_operationid_status(self.nodes[2], myopid)
 
         # Node 0 shields to Node 2, a coinbase utxo of value 10.0 less default fee
-        zsendamount = Decimal('10.0') - DEFAULT_FEE
-        result = self.nodes[0].z_shieldcoinbase(taddr0, zaddr2, DEFAULT_FEE, 1)
+        zsendamount = Decimal('10.0') - LEGACY_DEFAULT_FEE
+        result = self.nodes[0].z_shieldcoinbase(taddr0, zaddr2, LEGACY_DEFAULT_FEE, 1)
         txid_shielded = wait_and_assert_operationid_status(self.nodes[0], result['opid'])
 
         # Skip over the three blocks prior to activation; no transactions can be mined
@@ -86,7 +86,7 @@ def run_test (self):
 
         # Verify balance
         assert_equal(self.nodes[1].z_getbalance(taddr1), Decimal('0.5'))
-        assert_equal(self.nodes[2].getbalance(), Decimal('0.5') - DEFAULT_FEE)
+        assert_equal(self.nodes[2].getbalance(), Decimal('0.5') - LEGACY_DEFAULT_FEE)
         assert_equal(self.nodes[2].z_getbalance(zaddr2), zsendamount)
 
         # Verify transaction version is 4 (intended for Sapling+)
@@ -139,12 +139,12 @@ def run_test (self):
         # Node 3 sends the zero-confirmation transparent funds to Node 1 using z_sendmany
         recipients = []
         recipients.append({"address":taddr1, "amount": Decimal('0.5')})
-        myopid = self.nodes[3].z_sendmany(taddr3, recipients, 0, DEFAULT_FEE, 'AllowFullyTransparent')
+        myopid = self.nodes[3].z_sendmany(taddr3, recipients, 0, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent')
         txid_zsendmany = wait_and_assert_operationid_status(self.nodes[3], myopid)
 
         # Node 0 shields to Node 3, a coinbase utxo of value 10.0 less default fee
-        zsendamount = Decimal('10.0') - DEFAULT_FEE
-        result = self.nodes[0].z_shieldcoinbase(taddr0, zaddr3, DEFAULT_FEE, 1)
+        zsendamount = Decimal('10.0') - LEGACY_DEFAULT_FEE
+        result = self.nodes[0].z_shieldcoinbase(taddr0, zaddr3, LEGACY_DEFAULT_FEE, 1)
         txid_shielded = wait_and_assert_operationid_status(self.nodes[0], result['opid'])
 
         # Mine the first Blossom block
@@ -162,7 +162,7 @@ def run_test (self):
 
         # Verify balance
         assert_equal(self.nodes[1].z_getbalance(taddr1), Decimal('1.0'))
-        assert_equal(self.nodes[3].getbalance(), Decimal('0.5') - DEFAULT_FEE)
+        assert_equal(self.nodes[3].getbalance(), Decimal('0.5') - LEGACY_DEFAULT_FEE)
         assert_equal(self.nodes[3].z_getbalance(zaddr3), zsendamount)
 
         # Verify transaction version is 4 (intended for Sapling+)
diff --git a/qa/rpc-tests/wallet_sapling.py b/qa/rpc-tests/wallet_sapling.py
index f95569c7393..609a35437bd 100755
--- a/qa/rpc-tests/wallet_sapling.py
+++ b/qa/rpc-tests/wallet_sapling.py
@@ -9,7 +9,7 @@
     get_coinbase_address,
     start_nodes,
     wait_and_assert_operationid_status,
-    DEFAULT_FEE
+    LEGACY_DEFAULT_FEE
 )
 
 from decimal import Decimal
@@ -159,8 +159,8 @@ def run_test(self):
         myopid = self.nodes[1].z_sendmany(
             taddr1,
             [{'address': node4_sproutaddr, 'amount': Decimal('2.5')},
-             {'address': node4_saplingaddr, 'amount': Decimal('2.5') - DEFAULT_FEE}],
-            1, DEFAULT_FEE, 'AllowRevealedSenders'
+             {'address': node4_saplingaddr, 'amount': Decimal('2.5') - LEGACY_DEFAULT_FEE}],
+            1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders'
         )
         wait_and_assert_operationid_status(self.nodes[1], myopid, "failed", "Sending funds into the Sprout pool is no longer supported.")
 
diff --git a/qa/rpc-tests/wallet_sendmany_any_taddr.py b/qa/rpc-tests/wallet_sendmany_any_taddr.py
index 64df0b66249..0fbfd5442a1 100755
--- a/qa/rpc-tests/wallet_sendmany_any_taddr.py
+++ b/qa/rpc-tests/wallet_sendmany_any_taddr.py
@@ -5,7 +5,7 @@
 
 from test_framework.test_framework import BitcoinTestFramework
 from test_framework.util import (
-    DEFAULT_FEE,
+    LEGACY_DEFAULT_FEE,
     assert_equal,
     connect_nodes_bi,
     start_nodes,
@@ -58,7 +58,7 @@ def run_test(self):
                     {'address': node3taddr2, 'amount': 75},
                 ],
                 1,
-                DEFAULT_FEE,
+                LEGACY_DEFAULT_FEE,
                 'AllowRevealedRecipients',
             ),
         )
@@ -77,7 +77,7 @@ def run_test(self):
             self.nodes[3].z_sendmany(
                 'ANY_TADDR',
                 [{'address': recipient, 'amount': 100}],
-                1, DEFAULT_FEE, 'AllowFullyTransparent'),
+                1, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent'),
         )
 
         self.sync_all()
@@ -97,7 +97,7 @@ def run_test(self):
             self.nodes[3].z_sendmany(
                 'ANY_TADDR',
                 [{'address': recipient, 'amount': 20}],
-                1, DEFAULT_FEE, 'AllowFullyTransparent'),
+                1, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent'),
         )
 
         self.sync_all()
@@ -111,7 +111,7 @@ def run_test(self):
         myopid = self.nodes[3].z_sendmany(
             'ANY_TADDR',
             [{'address': recipient, 'amount': 20}],
-            1, DEFAULT_FEE, 'AllowRevealedSenders')
+            1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
         wait_and_assert_operationid_status(self.nodes[3], myopid, "failed", "Insufficient funds: have 14.99998, need 20.00001; note that coinbase outputs will not be selected if you specify ANY_TADDR, any transparent recipients are included, or if the `privacyPolicy` parameter is not set to `AllowRevealedSenders` or weaker.")
 
         # Create an expired transaction on node 3.
@@ -143,7 +143,7 @@ def run_test(self):
             self.nodes[2].z_sendmany(
                 'ANY_TADDR',
                 [{'address': recipient, 'amount': 13}],
-                1, DEFAULT_FEE, 'AllowRevealedSenders'),
+                1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders'),
             "failed", "Insufficient funds: have 0.00, need 13.00001; note that coinbase outputs will not be selected if you specify ANY_TADDR, any transparent recipients are included, or if the `privacyPolicy` parameter is not set to `AllowRevealedSenders` or weaker.")
 
 if __name__ == '__main__':
diff --git a/qa/rpc-tests/wallet_shieldcoinbase.py b/qa/rpc-tests/wallet_shieldcoinbase.py
index 478d4c62281..84f1d18660f 100755
--- a/qa/rpc-tests/wallet_shieldcoinbase.py
+++ b/qa/rpc-tests/wallet_shieldcoinbase.py
@@ -7,7 +7,7 @@
 from test_framework.authproxy import JSONRPCException
 from test_framework.util import assert_equal, initialize_chain_clean, \
     start_node, connect_nodes_bi, sync_blocks, sync_mempools, \
-    wait_and_assert_operationid_status, get_coinbase_address, DEFAULT_FEE, \
+    wait_and_assert_operationid_status, get_coinbase_address, LEGACY_DEFAULT_FEE, \
     NU5_BRANCH_ID, nuparams
 from test_framework.zip317 import conventional_fee
 
@@ -170,13 +170,13 @@ def verify_locking(first, second, limit):
         self.nodes[0].generate(200)
         self.sync_all()
         mytaddr = get_coinbase_address(self.nodes[0], 100)
-        result = self.nodes[0].z_shieldcoinbase(mytaddr, myzaddr, DEFAULT_FEE, None, 'DEADBEEF')
+        result = self.nodes[0].z_shieldcoinbase(mytaddr, myzaddr, LEGACY_DEFAULT_FEE, None, 'DEADBEEF')
         assert_equal(result["shieldingUTXOs"], Decimal('50'))
         assert_equal(result["remainingUTXOs"], Decimal('50'))
         wait_and_assert_operationid_status(self.nodes[0], result['opid'])
 
         # Verify maximum number of utxos which node 0 can shield can be set by the limit parameter
-        result = self.nodes[0].z_shieldcoinbase(mytaddr, myzaddr, DEFAULT_FEE, 33, None)
+        result = self.nodes[0].z_shieldcoinbase(mytaddr, myzaddr, LEGACY_DEFAULT_FEE, 33, None)
         assert_equal(result["shieldingUTXOs"], Decimal('33'))
         assert_equal(result["remainingUTXOs"], Decimal('17'))
         wait_and_assert_operationid_status(self.nodes[0], result['opid'])
diff --git a/qa/rpc-tests/wallet_shieldingcoinbase.py b/qa/rpc-tests/wallet_shieldingcoinbase.py
index 963525dd7e0..117f74df815 100755
--- a/qa/rpc-tests/wallet_shieldingcoinbase.py
+++ b/qa/rpc-tests/wallet_shieldingcoinbase.py
@@ -9,7 +9,7 @@
 from test_framework.util import assert_equal, initialize_chain_clean, \
     start_nodes, connect_nodes_bi, wait_and_assert_operationid_status, \
     wait_and_assert_operationid_status_result, get_coinbase_address, \
-    check_node_log, DEFAULT_FEE
+    check_node_log, LEGACY_DEFAULT_FEE
 from test_framework.zip317 import conventional_fee, WEIGHT_RATIO_CAP, ZIP_317_FEE
 
 import sys
@@ -106,7 +106,7 @@ def run_test (self):
         recipients = []
         recipients.append({"address":myzaddr, "amount":Decimal('1.23456789')})
 
-        myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 10, DEFAULT_FEE, 'AllowFullyTransparent')
+        myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 10, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent')
         error_result = wait_and_assert_operationid_status_result(
                 self.nodes[0],
                 myopid, "failed",
@@ -116,7 +116,7 @@ def run_test (self):
         # Test that the returned status object contains a params field with the operation's input parameters
         assert_equal(error_result["method"], "z_sendmany")
         params = error_result["params"]
-        assert_equal(params["fee"], DEFAULT_FEE) # default
+        assert_equal(params["fee"], LEGACY_DEFAULT_FEE) # default
         assert_equal(params["minconf"], Decimal('10')) # default
         assert_equal(params["fromaddress"], mytaddr)
         assert_equal(params["amounts"][0]["address"], myzaddr)
@@ -128,10 +128,10 @@ def run_test (self):
 
         # This send will succeed.  We send two coinbase utxos totalling 20.0 less a default fee, with no change.
         # (This tx fits within the block unpaid action limit.)
-        shieldvalue = Decimal('20.0') - DEFAULT_FEE
+        shieldvalue = Decimal('20.0') - LEGACY_DEFAULT_FEE
         recipients = []
         recipients.append({"address":myzaddr, "amount": shieldvalue})
-        myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 10, DEFAULT_FEE, 'AllowRevealedSenders')
+        myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 10, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
         mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid)
         self.sync_all()
 
@@ -210,7 +210,7 @@ def run_test (self):
         unshieldvalue = Decimal('10.0')
         recipients = []
         recipients.append({"address":mytaddr, "amount": unshieldvalue})
-        myopid = self.nodes[0].z_sendmany(myzaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedRecipients')
+        myopid = self.nodes[0].z_sendmany(myzaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients')
         mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid)
         assert(mytxid is not None)
 
@@ -219,7 +219,7 @@ def run_test (self):
         self.sync_all()
 
         # check balances
-        saplingvalue -= unshieldvalue + DEFAULT_FEE
+        saplingvalue -= unshieldvalue + LEGACY_DEFAULT_FEE
         resp = self.nodes[0].z_gettotalbalance()
         assert_equal(Decimal(resp["transparent"]), Decimal('30.0'))
         assert_equal(Decimal(resp["private"]), saplingvalue)
@@ -248,7 +248,7 @@ def run_test (self):
         recipients.append({"address":self.nodes[1].getnewaddress(), "amount":Decimal('10000.0')})
         myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1)
         wait_and_assert_operationid_status(self.nodes[0], myopid, "failed", "Insufficient funds: have 10.00, need 10000.0001; note that coinbase outputs will not be selected if you specify ANY_TADDR, any transparent recipients are included, or if the `privacyPolicy` parameter is not set to `AllowRevealedSenders` or weaker.")
-        myopid = self.nodes[0].z_sendmany(myzaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedRecipients')
+        myopid = self.nodes[0].z_sendmany(myzaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients')
         wait_and_assert_operationid_status(self.nodes[0], myopid, "failed", "Insufficient funds: have 9.99998, need 10000.00001; note that coinbase outputs will not be selected if you specify ANY_TADDR, any transparent recipients are included, or if the `privacyPolicy` parameter is not set to `AllowRevealedSenders` or weaker.")
 
         # Send will fail because of insufficient funds unless sender uses coinbase utxos
diff --git a/qa/rpc-tests/wallet_treestate.py b/qa/rpc-tests/wallet_treestate.py
index 29f65b4922c..934c74bd60b 100755
--- a/qa/rpc-tests/wallet_treestate.py
+++ b/qa/rpc-tests/wallet_treestate.py
@@ -6,7 +6,7 @@
 from test_framework.test_framework import BitcoinTestFramework
 from test_framework.util import assert_equal, initialize_chain_clean, \
     start_nodes, connect_nodes_bi, wait_and_assert_operationid_status, \
-    get_coinbase_address, DEFAULT_FEE
+    get_coinbase_address, LEGACY_DEFAULT_FEE
 from test_framework.zip317 import conventional_fee
 
 import time
@@ -46,18 +46,18 @@ def run_test (self):
 
         # Spend coinbase utxos to create three notes of 10 ZEC minus default fee each
         recipients = []
-        recipients.append({"address": myzaddr, "amount": Decimal('10.0') - DEFAULT_FEE})
-        myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
+        recipients.append({"address": myzaddr, "amount": Decimal('10.0') - LEGACY_DEFAULT_FEE})
+        myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
         wait_and_assert_operationid_status(self.nodes[0], myopid)
         self.sync_all()
         self.nodes[1].generate(1)
         self.sync_all()
-        myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
+        myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
         wait_and_assert_operationid_status(self.nodes[0], myopid)
         self.sync_all()
         self.nodes[1].generate(1)
         self.sync_all()
-        myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
+        myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
         wait_and_assert_operationid_status(self.nodes[0], myopid)
         self.sync_all()
         self.nodes[1].generate(1)
@@ -65,7 +65,7 @@ def run_test (self):
 
         # Check balance
         resp = self.nodes[0].z_getbalance(myzaddr)
-        assert_equal(Decimal(resp), (Decimal('10.0') - DEFAULT_FEE) * 3)
+        assert_equal(Decimal(resp), (Decimal('10.0') - LEGACY_DEFAULT_FEE) * 3)
 
         # We want to test a real-world situation where during the time spent creating a transaction
         # with joinsplits, other transactions containing joinsplits have been mined into new blocks,
@@ -73,8 +73,8 @@ def run_test (self):
 
         # Tx 1 will change the treestate while Tx 2 containing chained joinsplits is still being generated
         recipients = []
-        recipients.append({"address": self.nodes[2].z_getnewaddress(), "amount": Decimal('10.0') - DEFAULT_FEE})
-        myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
+        recipients.append({"address": self.nodes[2].z_getnewaddress(), "amount": Decimal('10.0') - LEGACY_DEFAULT_FEE})
+        myopid = self.nodes[0].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
         wait_and_assert_operationid_status(self.nodes[0], myopid)
 
         # Tx 2 will consume all three notes, which must take at least two joinsplits.  This is regardless of
diff --git a/qa/rpc-tests/wallet_unified_change.py b/qa/rpc-tests/wallet_unified_change.py
index 5c618c3e33a..a027363cef9 100755
--- a/qa/rpc-tests/wallet_unified_change.py
+++ b/qa/rpc-tests/wallet_unified_change.py
@@ -6,7 +6,7 @@
 from decimal import Decimal
 from test_framework.test_framework import BitcoinTestFramework
 from test_framework.util import (
-    DEFAULT_FEE,
+    LEGACY_DEFAULT_FEE,
     NU5_BRANCH_ID,
     assert_equal,
     get_coinbase_address,
@@ -43,11 +43,11 @@ def run_test(self):
 
         # Fund both of ua0_sapling and ua0_orchard
         recipients = [{'address': ua0_sapling, 'amount': Decimal('9.99999000')}]
-        opid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
+        opid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
         wait_and_assert_operationid_status(self.nodes[0], opid)
 
         recipients = [{'address': ua0_orchard, 'amount': Decimal('9.99999000')}]
-        opid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, DEFAULT_FEE, 'AllowRevealedSenders')
+        opid = self.nodes[0].z_sendmany(get_coinbase_address(self.nodes[0]), recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedSenders')
         wait_and_assert_operationid_status(self.nodes[0], opid)
 
         self.sync_all()
@@ -62,11 +62,11 @@ def run_test(self):
         # in account1 having both Sapling and Orchard balances.
 
         recipients = [{'address': ua1_sapling, 'amount': 5}]
-        opid = self.nodes[0].z_sendmany(ua0_sapling, recipients, 1, DEFAULT_FEE)
+        opid = self.nodes[0].z_sendmany(ua0_sapling, recipients, 1, LEGACY_DEFAULT_FEE)
         txid_sapling = wait_and_assert_operationid_status(self.nodes[0], opid)
 
         recipients = [{'address': ua1, 'amount': 5}]
-        opid = self.nodes[0].z_sendmany(ua0_orchard, recipients, 1, DEFAULT_FEE)
+        opid = self.nodes[0].z_sendmany(ua0_orchard, recipients, 1, LEGACY_DEFAULT_FEE)
         txid_orchard = wait_and_assert_operationid_status(self.nodes[0], opid)
 
         assert_equal(set([txid_sapling, txid_orchard]), set(self.nodes[0].getrawmempool()))
diff --git a/qa/rpc-tests/wallet_z_sendmany.py b/qa/rpc-tests/wallet_z_sendmany.py
index 42efdb79dc7..ce2d7962772 100755
--- a/qa/rpc-tests/wallet_z_sendmany.py
+++ b/qa/rpc-tests/wallet_z_sendmany.py
@@ -5,7 +5,7 @@
 
 from test_framework.test_framework import BitcoinTestFramework
 from test_framework.util import (
-    DEFAULT_FEE,
+    LEGACY_DEFAULT_FEE,
     NU5_BRANCH_ID,
     assert_equal,
     assert_greater_than,
@@ -107,14 +107,14 @@ def run_test(self):
         # send node 2 taddr to zaddr
         recipients = []
         recipients.append({"address":myzaddr, "amount":7})
-        opid = self.nodes[2].z_sendmany(mytaddr, recipients, 1, DEFAULT_FEE, 'AllowFullyTransparent')
+        opid = self.nodes[2].z_sendmany(mytaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowFullyTransparent')
         mytxid = wait_and_assert_operationid_status(self.nodes[2], opid)
 
         self.sync_all()
 
         # check balances
         zsendmanynotevalue = Decimal('7.0')
-        zsendmanyfee = DEFAULT_FEE
+        zsendmanyfee = LEGACY_DEFAULT_FEE
         node2sproutbalance = Decimal('50.00000000')
         node2utxobalance = Decimal('210.00000000') - zsendmanynotevalue - zsendmanyfee
 
@@ -160,14 +160,14 @@ def run_test(self):
 
         # try sending with a memo to a taddr, which should fail
         recipients = [{"address":self.nodes[0].getnewaddress(), "amount":1, "memo":"DEADBEEF"}]
-        opid = self.nodes[2].z_sendmany(myzaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedRecipients')
+        opid = self.nodes[2].z_sendmany(myzaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients')
         wait_and_assert_operationid_status(self.nodes[2], opid, 'failed', 'Failed to build transaction: Memos cannot be sent to transparent addresses.')
 
         recipients = []
         recipients.append({"address":self.nodes[0].getnewaddress(), "amount":1})
         recipients.append({"address":self.nodes[2].getnewaddress(), "amount":1.0})
 
-        opid = self.nodes[2].z_sendmany(myzaddr, recipients, 1, DEFAULT_FEE, 'AllowRevealedRecipients')
+        opid = self.nodes[2].z_sendmany(myzaddr, recipients, 1, LEGACY_DEFAULT_FEE, 'AllowRevealedRecipients')
         wait_and_assert_operationid_status(self.nodes[2], opid)
         zbalance -= Decimal('2.0') + zsendmanyfee
 
diff --git a/qa/rpc-tests/zkey_import_export.py b/qa/rpc-tests/zkey_import_export.py
index b29fbac90ed..13d7d1c0f0d 100755
--- a/qa/rpc-tests/zkey_import_export.py
+++ b/qa/rpc-tests/zkey_import_export.py
@@ -7,14 +7,14 @@
 from test_framework.test_framework import BitcoinTestFramework
 from test_framework.util import assert_equal, assert_greater_than, start_nodes,\
     initialize_chain_clean, connect_nodes_bi, wait_and_assert_operationid_status, \
-    DEFAULT_FEE
+    LEGACY_DEFAULT_FEE
 from functools import reduce
 import logging
 import sys
 
 logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO, stream=sys.stdout)
 
-fee = DEFAULT_FEE # constant (but can be changed within reason)
+fee = LEGACY_DEFAULT_FEE # constant (but can be changed within reason)
 
 class ZkeyImportExportTest (BitcoinTestFramework):
 
diff --git a/qa/zcash/smoke_tests.py b/qa/zcash/smoke_tests.py
index b5c895417ce..4899cd10931 100755
--- a/qa/zcash/smoke_tests.py
+++ b/qa/zcash/smoke_tests.py
@@ -22,7 +22,7 @@
 from slickrpc import Proxy
 from slickrpc.exc import RpcException
 
-DEFAULT_FEE = Decimal('0.00001')
+LEGACY_DEFAULT_FEE = Decimal('0.00001')
 URL_FAUCET_DONATION = 'https://faucet.testnet.z.cash/donations'
 URL_FAUCET_TAP = 'https://faucet.testnet.z.cash/'
 
@@ -382,13 +382,13 @@ def transaction_chain(zcash):
         # taddr -> Sapling
         # Send it all here because z_sendmany pick a new t-addr for change
         sapling_balance = check_z_sendmany(
-            results, '4f', zcash, taddr_1, [(sapling_zaddr_1, taddr_balance - DEFAULT_FEE)])[0]
+            results, '4f', zcash, taddr_1, [(sapling_zaddr_1, taddr_balance - LEGACY_DEFAULT_FEE)])[0]
         taddr_balance = Decimal('0')
 
         # Sapling -> taddr
         taddr_balance = check_z_sendmany(
             results, '4i', zcash, sapling_zaddr_1, [(taddr_1, (starting_balance / Decimal('10')) * Decimal('3'))])[0]
-        sapling_balance -= taddr_balance + DEFAULT_FEE
+        sapling_balance -= taddr_balance + LEGACY_DEFAULT_FEE
 
         #
         # Intra-pool tests
@@ -396,13 +396,13 @@ def transaction_chain(zcash):
 
         # Sapling -> same Sapling
         sapling_balance = check_z_sendmany(
-            results, '4g',zcash, sapling_zaddr_1, [(sapling_zaddr_1, sapling_balance - DEFAULT_FEE)])[0]
+            results, '4g',zcash, sapling_zaddr_1, [(sapling_zaddr_1, sapling_balance - LEGACY_DEFAULT_FEE)])[0]
 
         # taddr -> different taddr
         # Sapling -> different Sapling
         (taddr_balance, sapling_balance) = check_z_sendmany_parallel(results, zcash, [
-            ('4e', taddr_1, [(taddr_2, taddr_balance - DEFAULT_FEE)]),
-            ('4h', sapling_zaddr_1, [(sapling_zaddr_2, sapling_balance - DEFAULT_FEE)]),
+            ('4e', taddr_1, [(taddr_2, taddr_balance - LEGACY_DEFAULT_FEE)]),
+            ('4h', sapling_zaddr_1, [(sapling_zaddr_2, sapling_balance - LEGACY_DEFAULT_FEE)]),
         ])
 
         # taddr -> multiple taddr
@@ -410,7 +410,7 @@ def transaction_chain(zcash):
         check_z_sendmany_parallel(results, zcash, [
             ('4p', taddr_2, [
                 (taddr_1, starting_balance / Decimal('10')),
-                (taddr_3, taddr_balance - (starting_balance / Decimal('10')) - DEFAULT_FEE),
+                (taddr_3, taddr_balance - (starting_balance / Decimal('10')) - LEGACY_DEFAULT_FEE),
             ]),
             ('4t', sapling_zaddr_2, [
                 (sapling_zaddr_1, starting_balance / Decimal('10')),
@@ -418,17 +418,17 @@ def transaction_chain(zcash):
             ]),
         ])
 
-        taddr_balance -= DEFAULT_FEE
-        sapling_balance -= DEFAULT_FEE
+        taddr_balance -= LEGACY_DEFAULT_FEE
+        sapling_balance -= LEGACY_DEFAULT_FEE
 
         # multiple Sapling -> Sapling
         # multiple taddr -> taddr
         check_z_mergetoaddress_parallel(results, zcash, [
-            ('4gg', [sapling_zaddr_1, sapling_zaddr_3], sapling_zaddr_2, sapling_balance - DEFAULT_FEE),
-            ('', [taddr_1, taddr_3], taddr_2, taddr_balance - DEFAULT_FEE),
+            ('4gg', [sapling_zaddr_1, sapling_zaddr_3], sapling_zaddr_2, sapling_balance - LEGACY_DEFAULT_FEE),
+            ('', [taddr_1, taddr_3], taddr_2, taddr_balance - LEGACY_DEFAULT_FEE),
         ])
-        sapling_balance -= DEFAULT_FEE
-        taddr_balance -= DEFAULT_FEE
+        sapling_balance -= LEGACY_DEFAULT_FEE
+        taddr_balance -= LEGACY_DEFAULT_FEE
         taddr_2_balance = taddr_balance
 
         #
@@ -441,13 +441,13 @@ def transaction_chain(zcash):
                 (taddr_3, starting_balance / Decimal('10')),
                 (sapling_zaddr_1, starting_balance / Decimal('10'))])[0]
         
-        sapling_balance -= (starting_balance / Decimal('10')) + DEFAULT_FEE
+        sapling_balance -= (starting_balance / Decimal('10')) + LEGACY_DEFAULT_FEE
         taddr_balance += starting_balance / Decimal('10')
 
         # taddr and Sapling -> Sapling
-        check_z_mergetoaddress(results, '4ee', zcash, [taddr_3, sapling_zaddr_1], sapling_zaddr_2, sapling_balance + (starting_balance / Decimal('10')) - DEFAULT_FEE)
+        check_z_mergetoaddress(results, '4ee', zcash, [taddr_3, sapling_zaddr_1], sapling_zaddr_2, sapling_balance + (starting_balance / Decimal('10')) - LEGACY_DEFAULT_FEE)
     
-        sapling_balance += (starting_balance / Decimal('10')) - DEFAULT_FEE
+        sapling_balance += (starting_balance / Decimal('10')) - LEGACY_DEFAULT_FEE
         taddr_balance -= starting_balance / Decimal('10')
 
         # Sapling -> multiple taddr
@@ -455,37 +455,37 @@ def transaction_chain(zcash):
                 (taddr_4, (starting_balance / Decimal('10'))),
                 (taddr_5, (starting_balance / Decimal('10')))])[0]
             
-        sapling_balance -= ((starting_balance / Decimal('10')) * Decimal('2')) + DEFAULT_FEE
+        sapling_balance -= ((starting_balance / Decimal('10')) * Decimal('2')) + LEGACY_DEFAULT_FEE
         taddr_balance += (starting_balance / Decimal('10')) * Decimal('2')
 
         # multiple taddr -> Sapling
-        check_z_mergetoaddress(results, '4bb',zcash, [taddr_4, taddr_5], sapling_zaddr_2, sapling_balance + ((starting_balance / Decimal('10')) * Decimal('2')) - DEFAULT_FEE)
-        sapling_balance += ((starting_balance / Decimal('10')) * Decimal('2')) - DEFAULT_FEE
+        check_z_mergetoaddress(results, '4bb',zcash, [taddr_4, taddr_5], sapling_zaddr_2, sapling_balance + ((starting_balance / Decimal('10')) * Decimal('2')) - LEGACY_DEFAULT_FEE)
+        sapling_balance += ((starting_balance / Decimal('10')) * Decimal('2')) - LEGACY_DEFAULT_FEE
         taddr_balance -= (starting_balance / Decimal('10')) * Decimal('2')
 
         # multiple Sapling -> taddr
-        check_z_mergetoaddress(None, '', zcash, [sapling_zaddr_1, sapling_zaddr_2, sapling_zaddr_3], taddr_2, taddr_2_balance + sapling_balance - DEFAULT_FEE)
-        taddr_balance += sapling_balance - DEFAULT_FEE
+        check_z_mergetoaddress(None, '', zcash, [sapling_zaddr_1, sapling_zaddr_2, sapling_zaddr_3], taddr_2, taddr_2_balance + sapling_balance - LEGACY_DEFAULT_FEE)
+        taddr_balance += sapling_balance - LEGACY_DEFAULT_FEE
         sapling_balance = Decimal('0')
 
         # taddr -> multiple Sapling
         taddr_2_balance = Decimal(zcash.z_getbalance(taddr_2)).quantize(Decimal('1.00000000'))
         check_z_sendmany(results, '4r', zcash, taddr_2, [
                 (sapling_zaddr_1, (starting_balance / Decimal('10'))),
-                (sapling_zaddr_2, taddr_2_balance - (starting_balance / Decimal('10')) - DEFAULT_FEE)])[0]
+                (sapling_zaddr_2, taddr_2_balance - (starting_balance / Decimal('10')) - LEGACY_DEFAULT_FEE)])[0]
 
-        sapling_balance = taddr_2_balance - DEFAULT_FEE
+        sapling_balance = taddr_2_balance - LEGACY_DEFAULT_FEE
         taddr_balance -= taddr_2_balance
 
         # multiple Sapling -> taddr
-        check_z_mergetoaddress(None, '', zcash, [sapling_zaddr_1, sapling_zaddr_2], taddr_2, sapling_balance - DEFAULT_FEE)
-        taddr_balance += sapling_balance -  DEFAULT_FEE
+        check_z_mergetoaddress(None, '', zcash, [sapling_zaddr_1, sapling_zaddr_2], taddr_2, sapling_balance - LEGACY_DEFAULT_FEE)
+        taddr_balance += sapling_balance -  LEGACY_DEFAULT_FEE
         sapling_balance = Decimal('0')
 
         # z_mergetoaddress taddr -> Sapling
         taddr_2_balance = Decimal(zcash.z_getbalance(taddr_2)).quantize(Decimal('1.00000000'))
-        check_z_mergetoaddress(results, '4cc', zcash,  [taddr_2], sapling_zaddr_1, taddr_2_balance - DEFAULT_FEE)
-        sapling_balance = taddr_2_balance - DEFAULT_FEE
+        check_z_mergetoaddress(results, '4cc', zcash,  [taddr_2], sapling_zaddr_1, taddr_2_balance - LEGACY_DEFAULT_FEE)
+        sapling_balance = taddr_2_balance - LEGACY_DEFAULT_FEE
         taddr_balance -= taddr_2_balance
     except Exception as e:
         print('Error: %s' % e)
@@ -515,7 +515,7 @@ def transaction_chain(zcash):
         for addr in all_addrs:
             balance = Decimal(zcash.z_getbalance(addr)).quantize(Decimal('1.00000000'))
             if balance > 0:
-                z_sendmany(None, '', zcash, addr, [(chain_end, balance - DEFAULT_FEE)])
+                z_sendmany(None, '', zcash, addr, [(chain_end, balance - LEGACY_DEFAULT_FEE)])
 
     return results
 
diff --git a/src/Makefile.test.include b/src/Makefile.test.include
index 6ef416753c3..4b85a640304 100644
--- a/src/Makefile.test.include
+++ b/src/Makefile.test.include
@@ -90,7 +90,6 @@ BITCOIN_TESTS =\
   test/net_tests.cpp \
   test/netbase_tests.cpp \
   test/pmt_tests.cpp \
-  test/policyestimator_tests.cpp \
   test/pow_tests.cpp \
   test/prevector_tests.cpp \
   test/raii_event_tests.cpp \
diff --git a/src/gtest/test_mempool.cpp b/src/gtest/test_mempool.cpp
index 2fe80c7f79e..4a905d71daf 100644
--- a/src/gtest/test_mempool.cpp
+++ b/src/gtest/test_mempool.cpp
@@ -7,7 +7,6 @@
 #include "main.h"
 #include "primitives/transaction.h"
 #include "txmempool.h"
-#include "policy/fees.h"
 #include "util/system.h"
 
 // Implementation is in test_checktransaction.cpp
diff --git a/src/test/policyestimator_tests.cpp b/src/test/policyestimator_tests.cpp
deleted file mode 100644
index add0215a367..00000000000
--- a/src/test/policyestimator_tests.cpp
+++ /dev/null
@@ -1,192 +0,0 @@
-// Copyright (c) 2011-2015 The Bitcoin Core developers
-// Copyright (c) 2017-2023 The Zcash developers
-// Distributed under the MIT software license, see the accompanying
-// file COPYING or https://www.opensource.org/licenses/mit-license.php .
-
-#include "policy/fees.h"
-#include "txmempool.h"
-#include "uint256.h"
-#include "util/system.h"
-
-#include "test/test_bitcoin.h"
-
-#include <boost/test/unit_test.hpp>
-
-BOOST_FIXTURE_TEST_SUITE(policyestimator_tests, BasicTestingSetup)
-
-BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
-{
-    CTxMemPool mpool(CFeeRate(1000));
-    TestMemPoolEntryHelper entry;
-    CAmount basefee(2000);
-    CAmount deltaFee(100);
-    std::vector<CAmount> feeV;
-
-    // Populate vectors of increasing fees
-    for (int j = 0; j < 10; j++) {
-        feeV.push_back(basefee * (j+1));
-    }
-
-    // Store the hashes of transactions that have been
-    // added to the mempool by their associate fee
-    // txHashes[j] is populated with transactions either of
-    // fee = basefee * (j+1)
-    std::vector<uint256> txHashes[10];
-
-    // Create a transaction template
-    CScript garbage;
-    for (unsigned int i = 0; i < 128; i++)
-        garbage.push_back('X');
-    CMutableTransaction tx;
-    std::list<CTransaction> dummyConflicted;
-    tx.vin.resize(1);
-    tx.vin[0].scriptSig = garbage;
-    tx.vout.resize(1);
-    tx.vout[0].nValue=0LL;
-    CFeeRate baseRate(basefee, ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION));
-
-    // Create a fake block
-    std::vector<CTransaction> block;
-    int blocknum = 0;
-
-    // Loop through 200 blocks
-    // At a decay .998 and 4 fee transactions per block
-    // This makes the tx count about 1.33 per bucket, above the 1 threshold
-    while (blocknum < 200) {
-        for (int j = 0; j < 10; j++) { // For each fee
-            for (int k = 0; k < 4; k++) { // add 4 fee txs
-                tx.vin[0].prevout.n = 10000*blocknum+100*j+k; // make transaction unique
-                uint256 hash = tx.GetHash();
-                mpool.addUnchecked(hash, entry.Fee(feeV[j]).Time(GetTime()).Height(blocknum).FromTx(tx, &mpool));
-                txHashes[j].push_back(hash);
-            }
-        }
-        //Create blocks where higher fee txs are included more often
-        for (int h = 0; h <= blocknum%10; h++) {
-            // 10/10 blocks add highest fee transactions
-            // 9/10 blocks add 2nd highest and so on until ...
-            // 1/10 blocks add lowest fee transactions
-            while (txHashes[9-h].size()) {
-                std::shared_ptr<const CTransaction> ptx = mpool.get(txHashes[9-h].back());
-                if (ptx)
-                    block.push_back(*ptx);
-                txHashes[9-h].pop_back();
-            }
-        }
-        mpool.removeForBlock(block, ++blocknum, dummyConflicted);
-        block.clear();
-        if (blocknum == 30) {
-            // At this point we should need to combine 5 buckets to get enough data points
-            // So estimateFee(1) should fail and estimateFee(2) should return somewhere around
-            // 8*baserate
-            BOOST_CHECK(mpool.estimateFee(1) == CFeeRate(0));
-            BOOST_CHECK(mpool.estimateFee(2).GetFeePerK() < 8*baseRate.GetFeePerK() + deltaFee);
-            BOOST_CHECK(mpool.estimateFee(2).GetFeePerK() > 8*baseRate.GetFeePerK() - deltaFee);
-        }
-    }
-
-    std::vector<CAmount> origFeeEst;
-    // Highest feerate is 10*baseRate and gets in all blocks,
-    // second highest feerate is 9*baseRate and gets in 9/10 blocks = 90%,
-    // third highest feerate is 8*base rate, and gets in 8/10 blocks = 80%,
-    // so estimateFee(1) should return 9*baseRate.
-    // Third highest feerate has 90% chance of being included by 2 blocks,
-    // so estimateFee(2) should return 8*baseRate etc...
-    for (int i = 1; i < 10;i++) {
-        origFeeEst.push_back(mpool.estimateFee(i).GetFeePerK());
-        if (i > 1) { // Fee estimates should be monotonically decreasing
-            BOOST_CHECK(origFeeEst[i-1] <= origFeeEst[i-2]);
-        }
-        BOOST_CHECK(origFeeEst[i-1] < (10-i)*baseRate.GetFeePerK() + deltaFee);
-        BOOST_CHECK(origFeeEst[i-1] > (10-i)*baseRate.GetFeePerK() - deltaFee);
-    }
-
-    // Mine 50 more blocks with no transactions happening, estimates shouldn't change
-    // We haven't decayed the moving average enough so we still have enough data points in every bucket
-    while (blocknum < 250)
-        mpool.removeForBlock(block, ++blocknum, dummyConflicted);
-
-    for (int i = 1; i < 10;i++) {
-        BOOST_CHECK(mpool.estimateFee(i).GetFeePerK() < origFeeEst[i-1] + deltaFee);
-        BOOST_CHECK(mpool.estimateFee(i).GetFeePerK() > origFeeEst[i-1] - deltaFee);
-    }
-
-
-    // Mine 15 more blocks with lots of transactions happening and not getting mined
-    // Estimates should go up
-    while (blocknum < 265) {
-        for (int j = 0; j < 10; j++) { // For each fee multiple
-            for (int k = 0; k < 4; k++) { // add 4 fee txs
-                tx.vin[0].prevout.n = 10000*blocknum+100*j+k;
-                uint256 hash = tx.GetHash();
-                mpool.addUnchecked(hash, entry.Fee(feeV[j]).Time(GetTime()).Height(blocknum).FromTx(tx, &mpool));
-                txHashes[j].push_back(hash);
-            }
-        }
-        mpool.removeForBlock(block, ++blocknum, dummyConflicted);
-    }
-
-    for (int i = 1; i < 10;i++) {
-        BOOST_CHECK(mpool.estimateFee(i).GetFeePerK() > origFeeEst[i-1] - deltaFee);
-    }
-
-    // Mine all those transactions
-    // Estimates should still not be below original
-    for (int j = 0; j < 10; j++) {
-        while(txHashes[j].size()) {
-            std::shared_ptr<const CTransaction> ptx = mpool.get(txHashes[j].back());
-            if (ptx)
-                block.push_back(*ptx);
-            txHashes[j].pop_back();
-        }
-    }
-    mpool.removeForBlock(block, 265, dummyConflicted);
-    block.clear();
-    for (int i = 1; i < 10;i++) {
-        BOOST_CHECK(mpool.estimateFee(i).GetFeePerK() > origFeeEst[i-1] - deltaFee);
-    }
-
-    // Mine 100 more blocks where everything is mined every block
-    // Estimates should be below original estimates (not possible for last estimate)
-    while (blocknum < 365) {
-        for (int j = 0; j < 10; j++) { // For each fee multiple
-            for (int k = 0; k < 4; k++) { // add 4 fee txs
-                tx.vin[0].prevout.n = 10000*blocknum+100*j+k;
-                uint256 hash = tx.GetHash();
-                mpool.addUnchecked(hash, entry.Fee(feeV[j]).Time(GetTime()).Height(blocknum).FromTx(tx, &mpool));
-                std::shared_ptr<const CTransaction> ptx = mpool.get(hash);
-                if (ptx)
-                    block.push_back(*ptx);
-
-            }
-        }
-        mpool.removeForBlock(block, ++blocknum, dummyConflicted);
-        block.clear();
-    }
-    for (int i = 1; i < 9; i++) {
-        BOOST_CHECK(mpool.estimateFee(i).GetFeePerK() < origFeeEst[i-1] - deltaFee);
-    }
-}
-
-
-BOOST_AUTO_TEST_CASE(TxConfirmStats_FindBucketIndex)
-{
-    std::vector<double> buckets {0.0, 3.5, 42.0};
-    TxConfirmStats txcs;
-
-    txcs.Initialize(buckets, MAX_BLOCK_CONFIRMS, DEFAULT_DECAY);
-
-    BOOST_CHECK_EQUAL(txcs.FindBucketIndex(-1.0), 0);
-    BOOST_CHECK_EQUAL(txcs.FindBucketIndex(0.0), 0);
-    BOOST_CHECK_EQUAL(txcs.FindBucketIndex(1.0), 1);
-    BOOST_CHECK_EQUAL(txcs.FindBucketIndex(3.5), 1);
-    BOOST_CHECK_EQUAL(txcs.FindBucketIndex(4.0), 2);
-    BOOST_CHECK_EQUAL(txcs.FindBucketIndex(43.0), 3);
-    BOOST_CHECK_EQUAL(txcs.FindBucketIndex(INF_FEERATE), 3);
-    BOOST_CHECK_EQUAL(txcs.FindBucketIndex(2.0*INF_FEERATE), 3);
-    BOOST_CHECK_EQUAL(txcs.FindBucketIndex(std::numeric_limits<double>::infinity()), 3);
-    BOOST_CHECK_EQUAL(txcs.FindBucketIndex(2.0*std::numeric_limits<double>::infinity()), 3);
-    BOOST_CHECK_EQUAL(txcs.FindBucketIndex(nan("")), 0);
-}
-
-BOOST_AUTO_TEST_SUITE_END()