diff --git a/src/miner.h b/src/miner.h --- a/src/miner.h +++ b/src/miner.h @@ -190,7 +190,8 @@ * Increments nPackagesSelected / nDescendantsUpdated with corresponding * statistics from the package selection (for logging statistics). */ - void addPackageTxs(int &nPackagesSelected, int &nDescendantsUpdated) + void addPackageTxs(const Config &config, int &nPackagesSelected, + int &nDescendantsUpdated) EXCLUSIVE_LOCKS_REQUIRED(mempool->cs); /** Enum for the results from TestForBlock */ @@ -217,7 +218,8 @@ * succeed, and they're here only as an extra check in case of suboptimal * node configuration. */ - bool TestPackageTransactions(const CTxMemPool::setEntries &package); + bool TestPackageTransactions(const Config &config, + const CTxMemPool::setEntries &package); /** * Return true if given transaction from mapTx has already been evaluated, * or if the transaction's cached data in mapTx is incorrect. diff --git a/src/miner.cpp b/src/miner.cpp --- a/src/miner.cpp +++ b/src/miner.cpp @@ -163,7 +163,7 @@ addPriorityTxs(); int nPackagesSelected = 0; int nDescendantsUpdated = 0; - addPackageTxs(nPackagesSelected, nDescendantsUpdated); + addPackageTxs(config, nPackagesSelected, nDescendantsUpdated); if (IsMagneticAnomalyEnabled(config, pindexPrev)) { // If magnetic anomaly is enabled, we make sure transaction are @@ -288,11 +288,11 @@ * - Serialized size (in case -blockmaxsize is in use) */ bool BlockAssembler::TestPackageTransactions( - const CTxMemPool::setEntries &package) { + const Config &config, const CTxMemPool::setEntries &package) { uint64_t nPotentialBlockSize = nBlockSize; for (const CTxMemPool::txiter it : package) { CValidationState state; - if (!ContextualCheckTransaction(*config, it->GetTx(), state, nHeight, + if (!ContextualCheckTransaction(config, it->GetTx(), state, nHeight, nLockTimeCutoff, nMedianTimePast)) { return false; } @@ -439,7 +439,7 @@ * @param[out] nPackagesSelected How many packages were selected * @param[out] nDescendantsUpdated Number of descendant transactions updated */ -void BlockAssembler::addPackageTxs(int &nPackagesSelected, +void BlockAssembler::addPackageTxs(const Config &config, int &nPackagesSelected, int &nDescendantsUpdated) { // selection algorithm orders the mempool based on feerate of a @@ -557,7 +557,7 @@ ancestors.insert(iter); // Test if all tx's are Final. - if (!TestPackageTransactions(ancestors)) { + if (!TestPackageTransactions(config, ancestors)) { if (fUsingModified) { mapModifiedTx.get().erase(modit); failedTx.insert(iter);