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