Changeset View
Changeset View
Standalone View
Standalone View
src/miner.cpp
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | int64_t UpdateTime(CBlockHeader *pblock, const Consensus::Params ¶ms, | ||||
// Updating time can change work required on testnet: | // Updating time can change work required on testnet: | ||||
if (params.fPowAllowMinDifficultyBlocks) { | if (params.fPowAllowMinDifficultyBlocks) { | ||||
pblock->nBits = GetNextWorkRequired(pindexPrev, pblock, params); | pblock->nBits = GetNextWorkRequired(pindexPrev, pblock, params); | ||||
} | } | ||||
return nNewTime - nOldTime; | return nNewTime - nOldTime; | ||||
} | } | ||||
uint64_t CTxMemPoolModifiedEntry::GetVirtualSizeWithAncestors() const { | |||||
return GetVirtualTransactionSize(nSizeWithAncestors, | |||||
nSigOpCountWithAncestors); | |||||
} | |||||
BlockAssembler::Options::Options() | BlockAssembler::Options::Options() | ||||
: nExcessiveBlockSize(DEFAULT_MAX_BLOCK_SIZE), | : nExcessiveBlockSize(DEFAULT_MAX_BLOCK_SIZE), | ||||
nMaxGeneratedBlockSize(DEFAULT_MAX_GENERATED_BLOCK_SIZE), | nMaxGeneratedBlockSize(DEFAULT_MAX_GENERATED_BLOCK_SIZE), | ||||
blockMinFeeRate(DEFAULT_BLOCK_MIN_TX_FEE_PER_KB) {} | blockMinFeeRate(DEFAULT_BLOCK_MIN_TX_FEE_PER_KB) {} | ||||
BlockAssembler::BlockAssembler(const CChainParams ¶ms, | BlockAssembler::BlockAssembler(const CChainParams ¶ms, | ||||
const CTxMemPool &_mempool, | const CTxMemPool &_mempool, | ||||
const Options &options) | const Options &options) | ||||
▲ Show 20 Lines • Show All 381 Lines • ▼ Show 20 Lines | while (mi != mempool->mapTx.get<ancestor_score>().end() || | ||||
packageSigOps = modit->nSigOpCountWithAncestors; | packageSigOps = modit->nSigOpCountWithAncestors; | ||||
} | } | ||||
if (packageFees < blockMinFeeRate.GetFee(packageSize)) { | if (packageFees < blockMinFeeRate.GetFee(packageSize)) { | ||||
// Everything else we might consider has a lower fee rate | // Everything else we might consider has a lower fee rate | ||||
return; | return; | ||||
} | } | ||||
// The following must not use virtual size since TestPackage relies on | |||||
// having an accurate call to | |||||
// GetMaxBlockSigOpsCount(blockSizeWithPackage). | |||||
if (!TestPackage(packageSize, packageSigOps)) { | if (!TestPackage(packageSize, packageSigOps)) { | ||||
if (fUsingModified) { | if (fUsingModified) { | ||||
// Since we always look at the best entry in mapModifiedTx, we | // Since we always look at the best entry in mapModifiedTx, we | ||||
// must erase failed entries so that we can consider the next | // must erase failed entries so that we can consider the next | ||||
// best entry on the next loop iteration | // best entry on the next loop iteration | ||||
mapModifiedTx.get<ancestor_score>().erase(modit); | mapModifiedTx.get<ancestor_score>().erase(modit); | ||||
failedTx.insert(iter); | failedTx.insert(iter); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 90 Lines • Show Last 20 Lines |