aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp10
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)
{