2017-08-02 07:19:28 -04:00
|
|
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
2021-12-30 14:36:57 -03:00
|
|
|
// Copyright (c) 2009-2021 The Bitcoin Core developers
|
2017-08-02 07:19:28 -04:00
|
|
|
// 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
|
|
|
|
|
2021-09-10 23:29:00 -03:00
|
|
|
#include <consensus/amount.h>
|
2017-08-02 07:19:28 -04:00
|
|
|
|
|
|
|
class CFeeRate;
|
|
|
|
struct FeeCalculation;
|
|
|
|
|
2021-11-12 13:13:29 -03:00
|
|
|
namespace wallet {
|
|
|
|
class CCoinControl;
|
|
|
|
class CWallet;
|
|
|
|
|
2017-08-02 07:19:28 -04:00
|
|
|
/**
|
2018-04-07 13:12:46 -03:00
|
|
|
* Return the minimum required absolute fee for this size
|
|
|
|
* based on the required fee rate
|
2017-08-02 07:19:28 -04:00
|
|
|
*/
|
2018-04-07 13:12:46 -03:00
|
|
|
CAmount GetRequiredFee(const CWallet& wallet, unsigned int nTxBytes);
|
2017-08-02 07:19:28 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Estimate the minimum fee considering user set parameters
|
|
|
|
* and the required fee
|
|
|
|
*/
|
2017-07-28 21:40:29 -04:00
|
|
|
CAmount GetMinimumFee(const CWallet& wallet, unsigned int nTxBytes, const CCoinControl& coin_control, FeeCalculation* feeCalc);
|
2017-08-02 07:19:28 -04:00
|
|
|
|
2018-03-05 18:39:48 -03:00
|
|
|
/**
|
|
|
|
* Return the minimum required feerate taking into account the
|
2018-04-07 13:12:46 -03:00
|
|
|
* minimum relay feerate and user set minimum transaction feerate
|
2018-03-05 18:39:48 -03:00
|
|
|
*/
|
2018-04-07 13:12:46 -03:00
|
|
|
CFeeRate GetRequiredFeeRate(const CWallet& wallet);
|
2018-03-05 18:39:48 -03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Estimate the minimum fee rate considering user set parameters
|
|
|
|
* and the required fee
|
|
|
|
*/
|
2017-07-28 21:40:29 -04:00
|
|
|
CFeeRate GetMinimumFeeRate(const CWallet& wallet, const CCoinControl& coin_control, FeeCalculation* feeCalc);
|
2018-03-05 18:39:48 -03:00
|
|
|
|
2017-08-02 07:19:28 -04:00
|
|
|
/**
|
|
|
|
* Return the maximum feerate for discarding change.
|
|
|
|
*/
|
2017-07-28 21:40:29 -04:00
|
|
|
CFeeRate GetDiscardRate(const CWallet& wallet);
|
2021-11-12 13:13:29 -03:00
|
|
|
} // namespace wallet
|
2017-08-02 07:19:28 -04:00
|
|
|
|
|
|
|
#endif // BITCOIN_WALLET_FEES_H
|