Bitcoin ABC 0.30.3
P2P Digital Currency
Public Member Functions | Private Attributes | Friends | List of all members
CFeeRate Class Reference

Fee rate in satoshis per kilobyte: Amount / kB. More...

#include <feerate.h>

Collaboration diagram for CFeeRate:
[legend]

Public Member Functions

constexpr CFeeRate ()
 Fee rate of 0 satoshis per kB. More...
 
constexpr CFeeRate (const Amount _nSatoshisPerK)
 
 CFeeRate (const Amount nFeePaid, size_t nBytes)
 Constructor for a fee rate in satoshis per kB. More...
 
Amount GetFee (size_t nBytes) const
 Return the fee in satoshis for the given size in bytes. More...
 
Amount GetFeeCeiling (size_t nBytes) const
 Return the ceiling of a fee calculation in satoshis for the given size in bytes. More...
 
Amount GetFeePerK () const
 Return the fee in satoshis for a size of 1000 bytes. More...
 
CFeeRateoperator+= (const CFeeRate &a)
 
std::string ToString () const
 
 SERIALIZE_METHODS (CFeeRate, obj)
 

Private Attributes

Amount nSatoshisPerK
 

Friends

constexpr bool operator== (const CFeeRate a, const CFeeRate b)
 Equality. More...
 
constexpr bool operator!= (const CFeeRate a, const CFeeRate b)
 
bool operator< (const CFeeRate &a, const CFeeRate &b)
 Comparison. More...
 
bool operator> (const CFeeRate &a, const CFeeRate &b)
 
bool operator<= (const CFeeRate &a, const CFeeRate &b)
 
bool operator>= (const CFeeRate &a, const CFeeRate &b)
 

Detailed Description

Fee rate in satoshis per kilobyte: Amount / kB.

Definition at line 21 of file feerate.h.

Constructor & Destructor Documentation

◆ CFeeRate() [1/3]

constexpr CFeeRate::CFeeRate ( )
inlineconstexpr

Fee rate of 0 satoshis per kB.

Definition at line 30 of file feerate.h.

◆ CFeeRate() [2/3]

constexpr CFeeRate::CFeeRate ( const Amount  _nSatoshisPerK)
inlineexplicitconstexpr

Definition at line 31 of file feerate.h.

◆ CFeeRate() [3/3]

CFeeRate::CFeeRate ( const Amount  nFeePaid,
size_t  nBytes 
)

Constructor for a fee rate in satoshis per kB.

The size in bytes must not exceed (2^63 - 1)

Definition at line 11 of file feerate.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ GetFee()

Amount CFeeRate::GetFee ( size_t  nBytes) const

Return the fee in satoshis for the given size in bytes.

Definition at line 49 of file feerate.cpp.

Here is the caller graph for this function:

◆ GetFeeCeiling()

Amount CFeeRate::GetFeeCeiling ( size_t  nBytes) const

Return the ceiling of a fee calculation in satoshis for the given size in bytes.

Definition at line 53 of file feerate.cpp.

Here is the caller graph for this function:

◆ GetFeePerK()

Amount CFeeRate::GetFeePerK ( ) const
inline

Return the fee in satoshis for a size of 1000 bytes.

Definition at line 54 of file feerate.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator+=()

CFeeRate & CFeeRate::operator+= ( const CFeeRate a)
inline

Definition at line 81 of file feerate.h.

◆ SERIALIZE_METHODS()

CFeeRate::SERIALIZE_METHODS ( CFeeRate  ,
obj   
)
inline

Definition at line 87 of file feerate.h.

◆ ToString()

std::string CFeeRate::ToString ( ) const

Definition at line 57 of file feerate.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator!=

constexpr bool operator!= ( const CFeeRate  a,
const CFeeRate  b 
)
friend

Definition at line 62 of file feerate.h.

◆ operator<

bool operator< ( const CFeeRate a,
const CFeeRate b 
)
friend

Comparison.

Definition at line 69 of file feerate.h.

◆ operator<=

bool operator<= ( const CFeeRate a,
const CFeeRate b 
)
friend

Definition at line 75 of file feerate.h.

◆ operator==

constexpr bool operator== ( const CFeeRate  a,
const CFeeRate  b 
)
friend

Equality.

Definition at line 59 of file feerate.h.

◆ operator>

bool operator> ( const CFeeRate a,
const CFeeRate b 
)
friend

Definition at line 72 of file feerate.h.

◆ operator>=

bool operator>= ( const CFeeRate a,
const CFeeRate b 
)
friend

Definition at line 78 of file feerate.h.

Member Data Documentation

◆ nSatoshisPerK

Amount CFeeRate::nSatoshisPerK
private

Definition at line 24 of file feerate.h.


The documentation for this class was generated from the following files: