Changeset View
Changeset View
Standalone View
Standalone View
src/miner.h
Show First 20 Lines • Show All 185 Lines • ▼ Show 20 Lines | private: | ||||
/** Add transactions based on tx "priority" */ | /** Add transactions based on tx "priority" */ | ||||
void addPriorityTxs(); | void addPriorityTxs(); | ||||
/** | /** | ||||
* 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 for the results from TestForBlock */ | ||||
enum class TestForBlockResult : uint8_t { | enum class TestForBlockResult : uint8_t { | ||||
TXFits = 0, | TXFits = 0, | ||||
TXCantFit = 1, | TXCantFit = 1, | ||||
BlockFinished = 3, | BlockFinished = 3, | ||||
}; | }; | ||||
Show All 17 Lines | private: | ||||
bool TestPackageTransactions(const CTxMemPool::setEntries &package); | bool TestPackageTransactions(const CTxMemPool::setEntries &package); | ||||
/** | /** | ||||
* Return true if given transaction from mapTx has already been evaluated, | * Return true if given transaction from mapTx has already been evaluated, | ||||
* or if the transaction's cached data in mapTx is incorrect. | * or if the transaction's cached data in mapTx is incorrect. | ||||
*/ | */ | ||||
bool SkipMapTxEntry(CTxMemPool::txiter it, | bool SkipMapTxEntry(CTxMemPool::txiter it, | ||||
indexed_modified_transaction_set &mapModifiedTx, | indexed_modified_transaction_set &mapModifiedTx, | ||||
CTxMemPool::setEntries &failedTx) | CTxMemPool::setEntries &failedTx) | ||||
EXCLUSIVE_LOCKS_REQUIRED(mempool.cs); | EXCLUSIVE_LOCKS_REQUIRED(mempool->cs); | ||||
/** Sort the package in an order that is valid to appear in a block */ | /** Sort the package in an order that is valid to appear in a block */ | ||||
void SortForBlock(const CTxMemPool::setEntries &package, | void SortForBlock(const CTxMemPool::setEntries &package, | ||||
CTxMemPool::txiter entry, | CTxMemPool::txiter entry, | ||||
std::vector<CTxMemPool::txiter> &sortedEntries); | std::vector<CTxMemPool::txiter> &sortedEntries); | ||||
/** | /** | ||||
* Add descendants of given transactions to mapModifiedTx with ancestor | * Add descendants of given transactions to mapModifiedTx with ancestor | ||||
* state updated assuming given transactions are inBlock. Returns number of | * state updated assuming given transactions are inBlock. Returns number of | ||||
* updated descendants. | * updated descendants. | ||||
*/ | */ | ||||
int UpdatePackagesForAdded(const CTxMemPool::setEntries &alreadyAdded, | int UpdatePackagesForAdded(const CTxMemPool::setEntries &alreadyAdded, | ||||
indexed_modified_transaction_set &mapModifiedTx) | indexed_modified_transaction_set &mapModifiedTx) | ||||
EXCLUSIVE_LOCKS_REQUIRED(mempool.cs); | EXCLUSIVE_LOCKS_REQUIRED(mempool->cs); | ||||
}; | }; | ||||
/** Modify the extranonce in a block */ | /** Modify the extranonce in a block */ | ||||
void IncrementExtraNonce(const Config &config, CBlock *pblock, | void IncrementExtraNonce(const Config &config, CBlock *pblock, | ||||
const CBlockIndex *pindexPrev, | const CBlockIndex *pindexPrev, | ||||
unsigned int &nExtraNonce); | unsigned int &nExtraNonce); | ||||
int64_t UpdateTime(CBlockHeader *pblock, const Config &config, | int64_t UpdateTime(CBlockHeader *pblock, const Config &config, | ||||
const CBlockIndex *pindexPrev); | const CBlockIndex *pindexPrev); | ||||
#endif // BITCOIN_MINER_H | #endif // BITCOIN_MINER_H |