Bitcoin ABC  0.24.7
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 
37  Amount round(const Amount currentMinFee);
38 
39 private:
40  std::set<Amount> feeset;
42 };
43 
44 #endif // BITCOIN_POLICY_FEES_H
FeeFilterRounder::insecure_rand
FastRandomContext insecure_rand
Definition: fees.h:41
uint256.h
CFeeRate
Fee rate in satoshis per kilobyte: Amount / kB.
Definition: feerate.h:21
MIN_FEERATE
static constexpr Amount MIN_FEERATE(10 *SATOSHI)
SATOSHI
static constexpr Amount SATOSHI
Definition: amount.h:153
random.h
MAX_FEERATE
static const Amount MAX_FEERATE(int64_t(1e7) *SATOSHI)
FeeFilterRounder
Definition: fees.h:28
Amount
Definition: amount.h:19
FeeFilterRounder::FeeFilterRounder
FeeFilterRounder(const CFeeRate &minIncrementalFee)
Create new FeeFilterRounder.
Definition: fees.cpp:11
FeeFilterRounder::feeset
std::set< Amount > feeset
Definition: fees.h:40
amount.h
FeeFilterRounder::round
Amount round(const Amount currentMinFee)
Quantize a minimum fee for privacy purpose before broadcast.
Definition: fees.cpp:21
FEE_SPACING
static const double FEE_SPACING
Spacing of FeeRate buckets.
Definition: fees.h:26
FastRandomContext
Fast randomness source.
Definition: random.h:129