mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
Merge 3c13f5d612 into merged_master (Bitcoin PR bitcoin/bitcoin#28956)
This commit is contained in:
commit
b15f9acb3d
15 changed files with 17 additions and 32 deletions
|
|
@ -43,7 +43,7 @@ void ResetProof(CBlockHeader& block)
|
|||
int64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev)
|
||||
{
|
||||
int64_t nOldTime = pblock->nTime;
|
||||
int64_t nNewTime{std::max<int64_t>(pindexPrev->GetMedianTimePast() + 1, TicksSinceEpoch<std::chrono::seconds>(GetAdjustedTime()))};
|
||||
int64_t nNewTime{std::max<int64_t>(pindexPrev->GetMedianTimePast() + 1, TicksSinceEpoch<std::chrono::seconds>(NodeClock::now()))};
|
||||
|
||||
if (nOldTime < nNewTime) {
|
||||
pblock->nTime = nNewTime;
|
||||
|
|
@ -148,7 +148,7 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc
|
|||
pblock->nVersion = gArgs.GetIntArg("-blockversion", pblock->nVersion);
|
||||
}
|
||||
|
||||
pblock->nTime = TicksSinceEpoch<std::chrono::seconds>(GetAdjustedTime());
|
||||
pblock->nTime = TicksSinceEpoch<std::chrono::seconds>(NodeClock::now());
|
||||
m_lock_time_cutoff = pindexPrev->GetMedianTimePast();
|
||||
|
||||
// ELEMENTS:
|
||||
|
|
@ -224,7 +224,7 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc
|
|||
|
||||
BlockValidationState state;
|
||||
if (m_options.test_block_validity && !TestBlockValidity(state, chainparams, m_chainstate, *pblock, pindexPrev,
|
||||
GetAdjustedTime, /*fCheckPOW=*/false, /*fCheckMerkleRoot=*/false)) {
|
||||
/*fCheckPOW=*/false, /*fCheckMerkleRoot=*/false)) {
|
||||
throw std::runtime_error(strprintf("%s: TestBlockValidity failed: %s", __func__, state.ToString()));
|
||||
}
|
||||
const auto time_2{SteadyClock::now()};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue