Improve comments per review

This commit is contained in:
Jack Grigg
2016-06-16 10:45:19 +12:00
parent 284e125957
commit 5e207f4ea5
3 changed files with 14 additions and 13 deletions

View File

@@ -158,7 +158,11 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
CBlock *pblock = &pblocktemplate->block; // pointer for convenience
pblock->nVersion = 4;
// Fake the blocks taking at least nPowTargetSpacing
// Fake the blocks taking at least nPowTargetSpacing to be mined.
// GetMedianTimePast() returns the median of 11 blocks, so the timestamp
// of the next block must be six spacings ahead of that to be at least
// one spacing ahead of the tip. Within 11 blocks of genesis, the median
// will be closer to the tip, and blocks will appear slower.
pblock->nTime = chainActive.Tip()->GetMedianTimePast()+6*Params().GetConsensus().nPowTargetSpacing;
CMutableTransaction txCoinbase(pblock->vtx[0]);
txCoinbase.vin[0].scriptSig = CScript() << (chainActive.Height()+1) << OP_0;