diff --git a/src/wallet/fees.cpp b/src/wallet/fees.cpp index af4eea6e7..f96030925 100644 --- a/src/wallet/fees.cpp +++ b/src/wallet/fees.cpp @@ -1,53 +1,53 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2017 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include #include #include #include #include #include #include #include -Amount GetMinimumFee(unsigned int nTxBytes, const CTxMemPool &pool, - Amount targetFee) { +static Amount GetMinimumFee(unsigned int nTxBytes, const CTxMemPool &pool, + Amount targetFee) { Amount nFeeNeeded = targetFee; if (nFeeNeeded == Amount::zero()) { nFeeNeeded = pool.estimateFee().GetFeeCeiling(nTxBytes); // ... unless we don't have enough mempool data for estimatefee, then // use fallbackFee. if (nFeeNeeded == Amount::zero()) { nFeeNeeded = CWallet::fallbackFee.GetFeeCeiling(nTxBytes); } } // Prevent user from paying a fee below minRelayTxFee or minTxFee. nFeeNeeded = std::max(nFeeNeeded, GetConfig().GetMinFeePerKB().GetFee(nTxBytes)); // But always obey the maximum. if (nFeeNeeded > maxTxFee) { nFeeNeeded = maxTxFee; } return nFeeNeeded; } Amount GetMinimumFee(unsigned int nTxBytes, const CTxMemPool &pool) { // payTxFee is the user-set global for desired feerate. return GetMinimumFee(nTxBytes, pool, payTxFee.GetFeeCeiling(nTxBytes)); } Amount GetMinimumFee(unsigned int nTxBytes, const CTxMemPool &pool, const CCoinControl &coinControl) { if (coinControl.fOverrideFeeRate && coinControl.m_feerate) { return GetMinimumFee(nTxBytes, pool, coinControl.m_feerate->GetFee(nTxBytes)); } else { return GetMinimumFee(nTxBytes, pool); } } diff --git a/src/wallet/fees.h b/src/wallet/fees.h index 64f857539..90c28d3f7 100644 --- a/src/wallet/fees.h +++ b/src/wallet/fees.h @@ -1,33 +1,27 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2017 The Bitcoin Core developers // Copyright (c) 2018 The Bitcoin developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_WALLET_FEES_H #define BITCOIN_WALLET_FEES_H #include class CCoinControl; class CTxMemPool; /** * Estimate the minimum fee considering user set parameters * and the required fee */ Amount GetMinimumFee(unsigned int nTxBytes, const CTxMemPool &pool); -/** - * Estimate the minimum fee considering required fee and targetFee - */ -Amount GetMinimumFee(unsigned int nTxBytes, const CTxMemPool &pool, - Amount targetFee); - /** * Estimate the minimum fee considering overriden fee rate from coin control */ Amount GetMinimumFee(unsigned int nTxBytes, const CTxMemPool &pool, const CCoinControl &coinControl); #endif // BITCOIN_WALLET_FEES_H