Bitcoin ABC 0.31.1
P2P Digital Currency
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Classes | Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes | List of all members
node::BlockFitter Class Reference

Check for block limits when adding transactions. More...

#include <blockfitter.h>

Collaboration diagram for node::BlockFitter:
[legend]

Classes

struct  Options
 

Public Member Functions

 BlockFitter (const Options &options)
 
 BlockFitter (const Config &config)
 
uint64_t getMaxGeneratedBlockSize () const
 
void resetBlock ()
 Clear the block's state and prepare for assembling a new block. More...
 
void addTx (size_t txSize, int64_t txSigChecks, Amount txFee)
 Account for this tx. More...
 
void removeTxUnchecked (size_t txSize, int64_t txSigChecks, Amount txFee)
 Remove accounting for this tx. More...
 
bool testTxFits (uint64_t txSize, int64_t txSigChecks) const
 Test if a new Tx would "fit" in the block. More...
 
bool isBelowBlockMinFeeRate (const CFeeRate &txFeeRate) const
 

Public Attributes

uint64_t nBlockSize
 
uint64_t nBlockTx
 
uint64_t nBlockSigChecks
 
Amount nFees
 

Static Public Attributes

static constexpr uint64_t COINBASE_RESERVED_SIZE {1000}
 
static constexpr uint64_t COINBASE_RESERVED_SIGCHECKS {100}
 

Private Attributes

uint64_t nMaxGeneratedBlockSize
 
uint64_t nMaxGeneratedBlockSigChecks
 
CFeeRate blockMinFeeRate
 

Detailed Description

Check for block limits when adding transactions.

Definition at line 17 of file blockfitter.h.

Constructor & Destructor Documentation

◆ BlockFitter() [1/2]

node::BlockFitter::BlockFitter ( const Options options)

Definition at line 22 of file blockfitter.cpp.

Here is the call graph for this function:

◆ BlockFitter() [2/2]

node::BlockFitter::BlockFitter ( const Config config)

Definition at line 63 of file blockfitter.cpp.

Member Function Documentation

◆ addTx()

void node::BlockFitter::addTx ( size_t  txSize,
int64_t  txSigChecks,
Amount  txFee 
)

Account for this tx.

Definition at line 76 of file blockfitter.cpp.

Here is the caller graph for this function:

◆ getMaxGeneratedBlockSize()

uint64_t node::BlockFitter::getMaxGeneratedBlockSize ( ) const
inline

Definition at line 43 of file blockfitter.h.

Here is the caller graph for this function:

◆ isBelowBlockMinFeeRate()

bool node::BlockFitter::isBelowBlockMinFeeRate ( const CFeeRate txFeeRate) const

Definition at line 103 of file blockfitter.cpp.

Here is the caller graph for this function:

◆ removeTxUnchecked()

void node::BlockFitter::removeTxUnchecked ( size_t  txSize,
int64_t  txSigChecks,
Amount  txFee 
)

Remove accounting for this tx.

No check is done that the tx was previously added to the block fitter.

Definition at line 83 of file blockfitter.cpp.

◆ resetBlock()

void node::BlockFitter::resetBlock ( )

Clear the block's state and prepare for assembling a new block.

Definition at line 66 of file blockfitter.cpp.

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

◆ testTxFits()

bool node::BlockFitter::testTxFits ( uint64_t  txSize,
int64_t  txSigChecks 
) const

Test if a new Tx would "fit" in the block.

Definition at line 91 of file blockfitter.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ blockMinFeeRate

CFeeRate node::BlockFitter::blockMinFeeRate
private

Definition at line 21 of file blockfitter.h.

◆ COINBASE_RESERVED_SIGCHECKS

constexpr uint64_t node::BlockFitter::COINBASE_RESERVED_SIGCHECKS {100}
staticconstexpr

Definition at line 25 of file blockfitter.h.

◆ COINBASE_RESERVED_SIZE

constexpr uint64_t node::BlockFitter::COINBASE_RESERVED_SIZE {1000}
staticconstexpr

Definition at line 24 of file blockfitter.h.

◆ nBlockSigChecks

uint64_t node::BlockFitter::nBlockSigChecks

Definition at line 30 of file blockfitter.h.

◆ nBlockSize

uint64_t node::BlockFitter::nBlockSize

Definition at line 28 of file blockfitter.h.

◆ nBlockTx

uint64_t node::BlockFitter::nBlockTx

Definition at line 29 of file blockfitter.h.

◆ nFees

Amount node::BlockFitter::nFees

Definition at line 31 of file blockfitter.h.

◆ nMaxGeneratedBlockSigChecks

uint64_t node::BlockFitter::nMaxGeneratedBlockSigChecks
private

Definition at line 20 of file blockfitter.h.

◆ nMaxGeneratedBlockSize

uint64_t node::BlockFitter::nMaxGeneratedBlockSize
private

Definition at line 19 of file blockfitter.h.


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