diff options
author | Eric Lombrozo <elombrozo@gmail.com> | 2013-01-08 14:58:06 -0800 |
---|---|---|
committer | Eric Lombrozo <elombrozo@gmail.com> | 2013-06-05 23:15:20 -0700 |
commit | aabdf9e899e9024927c26c194ad38142495f80bf (patch) | |
tree | 736c1df9b5cd042539083b5326b5a684c30a27bb /src/main.cpp | |
parent | 48343a0a506398e22349c791717500a20bfff511 (diff) |
Moved UpdateTime out of CBlockHeader and moved CBlockHeader into core.
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp index 28b32101d3..bd40476d4c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1300,13 +1300,13 @@ bool ConnectBestBlock(CValidationState &state) { } while(true); } -void CBlockHeader::UpdateTime(const CBlockIndex* pindexPrev) +void UpdateTime(CBlockHeader& block, const CBlockIndex* pindexPrev) { - nTime = max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime()); + block.nTime = max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime()); // Updating time can change work required on testnet: if (fTestNet) - nBits = GetNextWorkRequired(pindexPrev, this); + block.nBits = GetNextWorkRequired(pindexPrev, &block); } @@ -4366,7 +4366,7 @@ CBlockTemplate* CreateNewBlock(CReserveKey& reservekey) // Fill in header pblock->hashPrevBlock = pindexPrev->GetBlockHash(); - pblock->UpdateTime(pindexPrev); + UpdateTime(*pblock, pindexPrev); pblock->nBits = GetNextWorkRequired(pindexPrev, pblock); pblock->nNonce = 0; pblock->vtx[0].vin[0].scriptSig = CScript() << OP_0 << OP_0; @@ -4606,7 +4606,7 @@ void static BitcoinMiner(CWallet *pwallet) break; // Update nTime every few seconds - pblock->UpdateTime(pindexPrev); + UpdateTime(*pblock, pindexPrev); nBlockTime = ByteReverse(pblock->nTime); if (fTestNet) { |