diff options
| author | jtimon <[email protected]> | 2014-10-22 01:31:01 +0200 |
|---|---|---|
| committer | jtimon <[email protected]> | 2014-10-29 21:00:05 +0100 |
| commit | 22c4272bf4ea04689fc0ea08e637caa46ba12c98 (patch) | |
| tree | d3df14ade9168c18687d9a769ba62c328611ad6f /src/pow.cpp | |
| parent | Merge pull request #5100 (diff) | |
| download | discoin-22c4272bf4ea04689fc0ea08e637caa46ba12c98.tar.xz discoin-22c4272bf4ea04689fc0ea08e637caa46ba12c98.zip | |
MOVEONLY: Move void UpdateTime() from pow.o to miner.o (plus fix include main.h -> chain.h)
Diffstat (limited to 'src/pow.cpp')
| -rw-r--r-- | src/pow.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/pow.cpp b/src/pow.cpp index af7fc488e..483122a76 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -5,10 +5,9 @@ #include "pow.h" +#include "chain.h" #include "chainparams.h" #include "core/block.h" -#include "main.h" -#include "timedata.h" #include "uint256.h" #include "util.h" @@ -98,15 +97,6 @@ bool CheckProofOfWork(uint256 hash, unsigned int nBits) return true; } -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); -} - uint256 GetProofIncrement(unsigned int nBits) { uint256 bnTarget; |