Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
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 <consensus/amount.h>
9#include <random.h>
10#include <sync.h>
11#include <uint256.h>
12
13#include <map>
14#include <string>
15#include <vector>
16
17class CFeeRate;
18
19// Minimum and Maximum values for tracking feerates
20static constexpr Amount MIN_FEERATE(10 * SATOSHI);
22
23// We have to lump transactions into buckets based on feerate, but we want to be
24// able to give accurate estimates over a large range of potential feerates.
25// Therefore it makes sense to exponentially space the buckets
27static const double FEE_SPACING = 1.1;
28
46
47#endif // BITCOIN_POLICY_FEES_H
static constexpr Amount SATOSHI
Definition amount.h:143
Fee rate in satoshis per kilobyte: Amount / kB.
Definition feerate.h:21
Fast randomness source.
Definition random.h:156
const std::set< Amount > m_fee_set
Definition fees.h:42
FastRandomContext &insecure_rand GUARDED_BY(m_insecure_rand_mutex)
Amount round(const Amount currentMinFee) EXCLUSIVE_LOCKS_REQUIRED(!m_insecure_rand_mutex)
Quantize a minimum fee for privacy purpose before broadcast.
Definition fees.cpp:33
Mutex m_insecure_rand_mutex
Definition fees.h:43
static constexpr Amount MIN_FEERATE(10 *SATOSHI)
static const double FEE_SPACING
Spacing of FeeRate buckets.
Definition fees.h:27
static const Amount MAX_FEERATE(int64_t(1e7) *SATOSHI)
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition random.h:85
#define EXCLUSIVE_LOCKS_REQUIRED(...)