diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts --- a/src/qt/locale/bitcoin_en.ts +++ b/src/qt/locale/bitcoin_en.ts @@ -2853,20 +2853,17 @@ - - Pay only the required fee of %1 + + Estimated to begin confirmation by next block. - - - Estimated to begin confirmation within %n block(s). - - Estimated to begin confirmation within %n block. - Estimated to begin confirmation within %n blocks. - + + + Pay only the required fee of %1 + - + Warning: Invalid Bitcoin address diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -725,8 +725,7 @@ return; } - int nBlocksToConfirm = 1; - CFeeRate feeRate = g_mempool.estimateFee(nBlocksToConfirm); + CFeeRate feeRate = g_mempool.estimateFee(); // not enough data => minfee if (feeRate <= CFeeRate(Amount::zero())) { ui->labelSmartFee->setText( @@ -747,8 +746,7 @@ "/kB"); ui->labelSmartFee2->hide(); ui->labelFeeEstimation->setText( - tr("Estimated to begin confirmation within %n block(s).", "", - nBlocksToConfirm)); + tr("Estimated to begin confirmation by next block.")); } updateFeeMinimizedLabel(); diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -798,12 +798,7 @@ RPCTypeCheck(request.params, {UniValue::VNUM}); - int nBlocks = request.params[0].get_int(); - if (nBlocks < 1) { - nBlocks = 1; - } - - CFeeRate feeRate = g_mempool.estimateFee(nBlocks); + CFeeRate feeRate = g_mempool.estimateFee(); if (feeRate == CFeeRate(Amount::zero())) { return -1.0; } diff --git a/src/test/policyestimator_tests.cpp b/src/test/policyestimator_tests.cpp --- a/src/test/policyestimator_tests.cpp +++ b/src/test/policyestimator_tests.cpp @@ -56,11 +56,8 @@ // Check that the estimate is above the rolling minimum fee. This should // be true since we have not trimmed the mempool. - BOOST_CHECK(CFeeRate(Amount::zero()) == mpool.estimateFee(1)); - BOOST_CHECK(mpool.GetMinFee(1) <= mpool.estimateFee(2)); - BOOST_CHECK(mpool.GetMinFee(1) <= mpool.estimateFee(3)); - BOOST_CHECK(mpool.GetMinFee(1) <= mpool.estimateFee(4)); - BOOST_CHECK(mpool.GetMinFee(1) <= mpool.estimateFee(5)); + BOOST_CHECK(CFeeRate(Amount::zero()) == mpool.estimateFee()); + BOOST_CHECK(mpool.GetMinFee(1) <= mpool.estimateFee()); // Check that estimateFee returns the minimum rolling fee even when the // mempool grows very quickly and no blocks have been mined. @@ -98,10 +95,8 @@ CFeeRate(10000 * DEFAULT_BLOCK_MIN_TX_FEE_PER_KB, CTransaction(tx).GetTotalSize())); - for (int i = 1; i < 10; i++) { - BOOST_CHECK_MESSAGE(mpool.estimateFee(i) == mpool.GetMinFee(1), - "Confirm blocks has failed on iteration " << i); - } + BOOST_CHECK_MESSAGE(mpool.estimateFee() == mpool.GetMinFee(1), + "Confirm blocks has failed"); } BOOST_AUTO_TEST_SUITE_END() diff --git a/src/txmempool.h b/src/txmempool.h --- a/src/txmempool.h +++ b/src/txmempool.h @@ -743,7 +743,7 @@ TxMempoolInfo info(const uint256 &hash) const; std::vector infoAll() const; - CFeeRate estimateFee(int nBlocks) const; + CFeeRate estimateFee() const; size_t DynamicMemoryUsage() const; diff --git a/src/txmempool.cpp b/src/txmempool.cpp --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -950,7 +950,7 @@ return GetInfo(i); } -CFeeRate CTxMemPool::estimateFee(int nBlocks) const { +CFeeRate CTxMemPool::estimateFee() const { LOCK(cs); uint64_t maxMempoolSize = diff --git a/src/wallet/fees.cpp b/src/wallet/fees.cpp --- a/src/wallet/fees.cpp +++ b/src/wallet/fees.cpp @@ -18,7 +18,7 @@ Amount nFeeNeeded = targetFee; // User didn't set: use -txconfirmtarget to estimate... if (nFeeNeeded == Amount::zero()) { - nFeeNeeded = pool.estimateFee(nConfirmTarget).GetFeeCeiling(nTxBytes); + nFeeNeeded = pool.estimateFee().GetFeeCeiling(nTxBytes); // ... unless we don't have enough mempool data for estimatefee, then // use fallbackFee. if (nFeeNeeded == Amount::zero()) {