Bitcoin ABC  0.22.12
P2P Digital Currency
fees.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2016 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 #ifndef BITCOIN_POLICY_FEES_H
6 #define BITCOIN_POLICY_FEES_H
7 
8 #include <amount.h>
9 #include <random.h>
10 #include <uint256.h>
11 
12 #include <map>
13 #include <string>
14 #include <vector>
15 
16 class CFeeRate;
17 
18 // Minimum and Maximum values for tracking feerates
19 static constexpr Amount MIN_FEERATE(10 * SATOSHI);
20 static const Amount MAX_FEERATE(int64_t(1e7) * SATOSHI);
21 
22 // We have to lump transactions into buckets based on feerate, but we want to be
23 // able to give accurate estimates over a large range of potential feerates.
24 // Therefore it makes sense to exponentially space the buckets
26 static const double FEE_SPACING = 1.1;
27 
29 public:
31  explicit FeeFilterRounder(const CFeeRate &minIncrementalFee);
32 
34  Amount round(const Amount currentMinFee);
35 
36 private:
37  std::set<Amount> feeset;
39 };
40 
41 #endif // BITCOIN_POLICY_FEES_H
std::set< Amount > feeset
Definition: fees.h:37
Definition: amount.h:17
static constexpr Amount SATOSHI
Definition: amount.h:151
static const double FEE_SPACING
Spacing of FeeRate buckets.
Definition: fees.h:26
Fast randomness source.
Definition: random.h:111
FeeFilterRounder(const CFeeRate &minIncrementalFee)
Create new FeeFilterRounder.
Definition: fees.cpp:11
Amount round(const Amount currentMinFee)
Quantize a minimum fee for privacy purpose before broadcast.
Definition: fees.cpp:21
FastRandomContext insecure_rand
Definition: fees.h:38
Fee rate in satoshis per kilobyte: Amount / kB.
Definition: feerate.h:21
static constexpr Amount MIN_FEERATE(10 *SATOSHI)
static const Amount MAX_FEERATE(int64_t(1e7) *SATOSHI)