mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Merge pull request #5170
092b58dCBlockIndex::GetBlockWork() + GetProofIncrement(nBits) -> GetBlockProof(CBlockIndex) (jtimon)22c4272MOVEONLY: Move void UpdateTime() from pow.o to miner.o (plus fix include main.h -> chain.h) (jtimon)
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "main.h"
|
||||
#include "net.h"
|
||||
#include "pow.h"
|
||||
#include "timedata.h"
|
||||
#include "util.h"
|
||||
#include "utilmoneystr.h"
|
||||
#ifdef ENABLE_WALLET
|
||||
@@ -78,6 +79,15 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
void UpdateTime(CBlockHeader* pblock, const CBlockIndex* pindexPrev)
|
||||
{
|
||||
pblock->nTime = std::max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime());
|
||||
|
||||
// Updating time can change work required on testnet:
|
||||
if (Params().AllowMinDifficultyBlocks())
|
||||
pblock->nBits = GetNextWorkRequired(pindexPrev, pblock);
|
||||
}
|
||||
|
||||
CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
|
||||
{
|
||||
// Create new block
|
||||
|
||||
Reference in New Issue
Block a user