Changeset View
Changeset View
Standalone View
Standalone View
src/miner.h
Show First 20 Lines • Show All 153 Lines • ▼ Show 20 Lines | private: | ||||
// Chain context for the block | // Chain context for the block | ||||
int nHeight; | int nHeight; | ||||
int64_t nLockTimeCutoff; | int64_t nLockTimeCutoff; | ||||
int64_t nMedianTimePast; | int64_t nMedianTimePast; | ||||
const CChainParams &chainparams; | const CChainParams &chainparams; | ||||
const CTxMemPool *mempool; | const CTxMemPool *mempool; | ||||
// Variables used for addPriorityTxs | |||||
int lastFewTxs; | |||||
public: | public: | ||||
struct Options { | struct Options { | ||||
Options(); | Options(); | ||||
uint64_t nExcessiveBlockSize; | uint64_t nExcessiveBlockSize; | ||||
uint64_t nMaxGeneratedBlockSize; | uint64_t nMaxGeneratedBlockSize; | ||||
CFeeRate blockMinFeeRate; | CFeeRate blockMinFeeRate; | ||||
}; | }; | ||||
Show All 18 Lines | private: | ||||
/** | /** | ||||
* Add transactions based on feerate including unconfirmed ancestors. | * Add transactions based on feerate including unconfirmed ancestors. | ||||
* Increments nPackagesSelected / nDescendantsUpdated with corresponding | * Increments nPackagesSelected / nDescendantsUpdated with corresponding | ||||
* statistics from the package selection (for logging statistics). | * statistics from the package selection (for logging statistics). | ||||
*/ | */ | ||||
void addPackageTxs(int &nPackagesSelected, int &nDescendantsUpdated) | void addPackageTxs(int &nPackagesSelected, int &nDescendantsUpdated) | ||||
EXCLUSIVE_LOCKS_REQUIRED(mempool->cs); | EXCLUSIVE_LOCKS_REQUIRED(mempool->cs); | ||||
/** Enum for the results from TestForBlock */ | |||||
enum class TestForBlockResult : uint8_t { | |||||
TXFits = 0, | |||||
TXCantFit = 1, | |||||
BlockFinished = 3, | |||||
}; | |||||
// helper function for addPriorityTxs | |||||
/** Test if tx will still "fit" in the block */ | |||||
TestForBlockResult TestForBlock(CTxMemPool::txiter iter); | |||||
/** Test if tx still has unconfirmed parents not yet in block */ | |||||
bool isStillDependent(CTxMemPool::txiter iter) | |||||
EXCLUSIVE_LOCKS_REQUIRED(mempool->cs); | |||||
// helper functions for addPackageTxs() | // helper functions for addPackageTxs() | ||||
/** Remove confirmed (inBlock) entries from given set */ | /** Remove confirmed (inBlock) entries from given set */ | ||||
void onlyUnconfirmed(CTxMemPool::setEntries &testSet); | void onlyUnconfirmed(CTxMemPool::setEntries &testSet); | ||||
/** Test if a new package would "fit" in the block */ | /** Test if a new package would "fit" in the block */ | ||||
bool TestPackage(uint64_t packageSize, int64_t packageSigOpsCost) const; | bool TestPackage(uint64_t packageSize, int64_t packageSigOpsCost) const; | ||||
/** | /** | ||||
* Perform checks on each transaction in a package: | * Perform checks on each transaction in a package: | ||||
* locktime, serialized size (if necessary). These checks should always | * locktime, serialized size (if necessary). These checks should always | ||||
Show All 32 Lines |