fees.h raw

   1  // Copyright (c) 2009-2010 Satoshi Nakamoto
   2  // Copyright (c) 2009-present The Bitcoin Core developers
   3  // Distributed under the MIT software license, see the accompanying
   4  // file COPYING or http://www.opensource.org/licenses/mit-license.php.
   5  
   6  #ifndef BITCOIN_WALLET_FEES_H
   7  #define BITCOIN_WALLET_FEES_H
   8  
   9  #include <consensus/amount.h>
  10  
  11  class CFeeRate;
  12  struct FeeCalculation;
  13  
  14  namespace wallet {
  15  class CCoinControl;
  16  class CWallet;
  17  
  18  /**
  19   * Return the minimum required absolute fee for this size
  20   * based on the required fee rate
  21   */
  22  CAmount GetRequiredFee(const CWallet& wallet, unsigned int nTxBytes);
  23  
  24  /**
  25   * Estimate the minimum fee considering user set parameters
  26   * and the required fee
  27   */
  28  CAmount GetMinimumFee(const CWallet& wallet, unsigned int nTxBytes, const CCoinControl& coin_control, FeeCalculation* feeCalc);
  29  
  30  /**
  31   * Return the minimum required feerate taking into account the
  32   * minimum relay feerate and user set minimum transaction feerate
  33   */
  34  CFeeRate GetRequiredFeeRate(const CWallet& wallet);
  35  
  36  /**
  37   * Estimate the minimum fee rate considering user set parameters
  38   * and the required fee
  39   */
  40  CFeeRate GetMinimumFeeRate(const CWallet& wallet, const CCoinControl& coin_control, FeeCalculation* feeCalc);
  41  
  42  /**
  43   * Return the maximum feerate for discarding change.
  44   */
  45  CFeeRate GetDiscardRate(const CWallet& wallet);
  46  } // namespace wallet
  47  
  48  #endif // BITCOIN_WALLET_FEES_H
  49