mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02:00
Merge UP TO 551c8e9526 into merged_master (UP TO bitcoin/bitcoin#26349)
Includes FIXMEs for a few functional tests
This commit is contained in:
commit
ca0a68b350
295 changed files with 5068 additions and 1834 deletions
|
|
@ -119,7 +119,7 @@ void BlockAssembler::resetBlock()
|
|||
std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& scriptPubKeyIn, std::chrono::seconds min_tx_age, DynaFedParamEntry* proposed_entry, const std::vector<CScript>* commit_scripts)
|
||||
{
|
||||
assert(min_tx_age >= std::chrono::seconds(0));
|
||||
int64_t nTimeStart = GetTimeMicros();
|
||||
const auto time_start{SteadyClock::now()};
|
||||
|
||||
resetBlock();
|
||||
|
||||
|
|
@ -176,7 +176,7 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc
|
|||
addPackageTxs(*m_mempool, nPackagesSelected, nDescendantsUpdated, min_tx_age);
|
||||
}
|
||||
|
||||
int64_t nTime1 = GetTimeMicros();
|
||||
const auto time_1{SteadyClock::now()};
|
||||
|
||||
m_last_block_num_txs = nBlockTx;
|
||||
m_last_block_weight = nBlockWeight;
|
||||
|
|
@ -226,9 +226,12 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc
|
|||
if (!TestBlockValidity(state, chainparams, m_chainstate, *pblock, pindexPrev, GetAdjustedTime, false, false)) {
|
||||
throw std::runtime_error(strprintf("%s: TestBlockValidity failed: %s", __func__, state.ToString()));
|
||||
}
|
||||
int64_t nTime2 = GetTimeMicros();
|
||||
const auto time_2{SteadyClock::now()};
|
||||
|
||||
LogPrint(BCLog::BENCH, "CreateNewBlock() packages: %.2fms (%d packages, %d updated descendants), validity: %.2fms (total %.2fms)\n", 0.001 * (nTime1 - nTimeStart), nPackagesSelected, nDescendantsUpdated, 0.001 * (nTime2 - nTime1), 0.001 * (nTime2 - nTimeStart));
|
||||
LogPrint(BCLog::BENCH, "CreateNewBlock() packages: %.2fms (%d packages, %d updated descendants), validity: %.2fms (total %.2fms)\n",
|
||||
Ticks<MillisecondsDouble>(time_1 - time_start), nPackagesSelected, nDescendantsUpdated,
|
||||
Ticks<MillisecondsDouble>(time_2 - time_1),
|
||||
Ticks<MillisecondsDouble>(time_2 - time_start));
|
||||
|
||||
return std::move(pblocktemplate);
|
||||
}
|
||||
|
|
@ -310,14 +313,9 @@ static int UpdatePackagesForAdded(const CTxMemPool& mempool,
|
|||
modtxiter mit = mapModifiedTx.find(desc);
|
||||
if (mit == mapModifiedTx.end()) {
|
||||
CTxMemPoolModifiedEntry modEntry(desc);
|
||||
modEntry.nSizeWithAncestors -= it->GetTxSize();
|
||||
modEntry.discountSizeWithAncestors -= it->GetDiscountTxSize();
|
||||
modEntry.nModFeesWithAncestors -= it->GetModifiedFee();
|
||||
modEntry.nSigOpCostWithAncestors -= it->GetSigOpCost();
|
||||
mapModifiedTx.insert(modEntry);
|
||||
} else {
|
||||
mapModifiedTx.modify(mit, update_for_parent_inclusion(it));
|
||||
mit = mapModifiedTx.insert(modEntry).first;
|
||||
}
|
||||
mapModifiedTx.modify(mit, update_for_parent_inclusion(it));
|
||||
}
|
||||
}
|
||||
return nDescendantsUpdated;
|
||||
|
|
@ -464,9 +462,8 @@ void BlockAssembler::addPackageTxs(const CTxMemPool& mempool, int& nPackagesSele
|
|||
}
|
||||
|
||||
CTxMemPool::setEntries ancestors;
|
||||
uint64_t nNoLimit = std::numeric_limits<uint64_t>::max();
|
||||
std::string dummy;
|
||||
mempool.CalculateMemPoolAncestors(*iter, ancestors, nNoLimit, nNoLimit, nNoLimit, nNoLimit, dummy, false);
|
||||
mempool.CalculateMemPoolAncestors(*iter, ancestors, CTxMemPool::Limits::NoLimits(), dummy, false);
|
||||
|
||||
onlyUnconfirmed(ancestors);
|
||||
ancestors.insert(iter);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue