mempool.h raw

   1  // Copyright (c) 2017-2022 The Limenka developers
   2  // Distributed under the MIT software license, see the accompanying
   3  // file COPYING or http://www.opensource.org/licenses/mit-license.php.
   4  
   5  #ifndef LIMENKA_RPC_MEMPOOL_H
   6  #define LIMENKA_RPC_MEMPOOL_H
   7  
   8  #include <consensus/amount.h>
   9  
  10  #include <optional>
  11  #include <vector>
  12  
  13  class ChainstateManager;
  14  class CTxMemPool;
  15  class UniValue;
  16  
  17  typedef std::vector<CAmount> MempoolHistogramFeeRates;
  18  
  19  /* TODO: define log scale formular for dynamically creating the
  20   * feelimits but with the property of not constantly changing
  21   * (and thus screw up client implementations) */
  22  static const MempoolHistogramFeeRates MempoolInfoToJSON_const_histogram_floors{
  23      1, 2, 3, 4, 5, 6, 7, 8, 10,
  24      12, 14, 17, 20, 25, 30, 40, 50, 60, 70, 80, 100,
  25      120, 140, 170, 200, 250, 300, 400, 500, 600, 700, 800, 1000,
  26      1200, 1400, 1700, 2000, 2500, 3000, 4000, 5000, 6000, 7000, 8000, 10000};
  27  
  28  /** Mempool information to JSON */
  29  UniValue MempoolInfoToJSON(const CTxMemPool& pool, const std::optional<MempoolHistogramFeeRates>& histogram_floors);
  30  
  31  /** Mempool to JSON */
  32  UniValue MempoolToJSON(ChainstateManager& chainman, const CTxMemPool& pool, bool verbose = false, bool include_mempool_sequence = false);
  33  
  34  /** Mempool Txs to JSON */
  35  UniValue MempoolTxsToJSON(const CTxMemPool& pool, bool verbose = false, uint64_t sequence_start = 0);
  36  
  37  #endif // LIMENKA_RPC_MEMPOOL_H
  38