mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
MOVEONLY: Move void UpdateTime() from pow.o to miner.o (plus fix include main.h -> chain.h)
This commit is contained in:
parent
723c752636
commit
22c4272bf4
4 changed files with 13 additions and 13 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue