Expose only blockchain hash twice in header

This commit is contained in:
sanket1729 2021-01-25 19:38:15 -08:00
parent afb9e7b727
commit a26f6fead6
9 changed files with 37 additions and 34 deletions

View file

@ -1120,7 +1120,7 @@ bool MemPoolAccept::AcceptSingleTransaction(const CTransactionRef& ptx, ATMPArgs
// scripts (ie, other policy checks pass). We perform the inexpensive
// checks first and avoid hashing and signature verification unless those
// checks pass, to mitigate CPU exhaustion denial-of-service attacks.
PrecomputedTransactionData txdata(args.m_chainparams.ParentGenesisBlockHash(), args.m_chainparams.ParentPeggedAsset());
PrecomputedTransactionData txdata(args.m_chainparams.HashGenesisBlock());
if (!PolicyScriptChecks(args, workspace, txdata)) return false;
@ -2296,7 +2296,10 @@ bool CChainState::ConnectBlock(const CBlock& block, BlockValidationState& state,
// doesn't invalidate pointers into the vector, and keep txsdata in scope
// for as long as `control`.
CCheckQueueControl<CCheck> control(fScriptChecks && g_parallel_script_checks ? &scriptcheckqueue : nullptr);
std::vector<PrecomputedTransactionData> txsdata(block.vtx.size());
std::vector<PrecomputedTransactionData> txsdata;
for (unsigned int i = 0; i< block.vtx.size(); i++ ){
txsdata.push_back(PrecomputedTransactionData(chainparams.HashGenesisBlock()));
}
std::vector<int> prevheights;
CAmountMap fee_map;