aboutsummaryrefslogtreecommitdiff
path: root/src/test/miner_tests.cpp
diff options
context:
space:
mode:
authorGavin Andresen <[email protected]>2013-10-14 20:39:00 -0700
committerGavin Andresen <[email protected]>2013-10-14 20:39:00 -0700
commitb9beea6e9d0f789f11d249b040e549d535bdc295 (patch)
treee87c3422b52b1f6d78b88b9cea756c1f3cb8d37b /src/test/miner_tests.cpp
parentMerge pull request #2933 from sipa/leveldb113 (diff)
parentRefactor/encapsulate chain globals into a CChain class (diff)
downloaddiscoin-b9beea6e9d0f789f11d249b040e549d535bdc295.tar.xz
discoin-b9beea6e9d0f789f11d249b040e549d535bdc295.zip
Merge pull request #3077 from sipa/chain
Refactor/encapsulate chain globals into a CChain class
Diffstat (limited to 'src/test/miner_tests.cpp')
-rw-r--r--src/test/miner_tests.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp
index eeeacb0ad..67165760b 100644
--- a/src/test/miner_tests.cpp
+++ b/src/test/miner_tests.cpp
@@ -65,10 +65,10 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
{
CBlock *pblock = &pblocktemplate->block; // pointer for convenience
pblock->nVersion = 1;
- pblock->nTime = pindexBest->GetMedianTimePast()+1;
+ pblock->nTime = chainActive.Tip()->GetMedianTimePast()+1;
pblock->vtx[0].vin[0].scriptSig = CScript();
pblock->vtx[0].vin[0].scriptSig.push_back(blockinfo[i].extranonce);
- pblock->vtx[0].vin[0].scriptSig.push_back(pindexBest->nHeight);
+ pblock->vtx[0].vin[0].scriptSig.push_back(chainActive.Height());
pblock->vtx[0].vout[0].scriptPubKey = CScript();
if (txFirst.size() < 2)
txFirst.push_back(new CTransaction(pblock->vtx[0]));
@@ -193,14 +193,14 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
mempool.clear();
// subsidy changing
- int nHeight = pindexBest->nHeight;
- pindexBest->nHeight = 209999;
+ int nHeight = chainActive.Height();
+ chainActive.Tip()->nHeight = 209999;
BOOST_CHECK(pblocktemplate = CreateNewBlockWithKey(reservekey));
delete pblocktemplate;
- pindexBest->nHeight = 210000;
+ chainActive.Tip()->nHeight = 210000;
BOOST_CHECK(pblocktemplate = CreateNewBlockWithKey(reservekey));
delete pblocktemplate;
- pindexBest->nHeight = nHeight;
+ chainActive.Tip()->nHeight = nHeight;
BOOST_FOREACH(CTransaction *tx, txFirst)
delete tx;