Browse Source

Merge pull request #6222

efd4444 Explicitly set tx.nVersion for the genesis block and mining tests (Mark Friedenbach)
0.13
Wladimir J. van der Laan 10 years ago
parent
commit
9c93ee5ceb
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 1
      src/chainparams.cpp
  2. 1
      src/test/miner_tests.cpp

1
src/chainparams.cpp

@ -66,6 +66,7 @@ public:
*/ */
const char* pszTimestamp = "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks"; const char* pszTimestamp = "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks";
CMutableTransaction txNew; CMutableTransaction txNew;
txNew.nVersion = 1;
txNew.vin.resize(1); txNew.vin.resize(1);
txNew.vout.resize(1); txNew.vout.resize(1);
txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp)); txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));

1
src/test/miner_tests.cpp

@ -74,6 +74,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
pblock->nVersion = 1; pblock->nVersion = 1;
pblock->nTime = chainActive.Tip()->GetMedianTimePast()+1; pblock->nTime = chainActive.Tip()->GetMedianTimePast()+1;
CMutableTransaction txCoinbase(pblock->vtx[0]); CMutableTransaction txCoinbase(pblock->vtx[0]);
txCoinbase.nVersion = 1;
txCoinbase.vin[0].scriptSig = CScript(); txCoinbase.vin[0].scriptSig = CScript();
txCoinbase.vin[0].scriptSig.push_back(blockinfo[i].extranonce); txCoinbase.vin[0].scriptSig.push_back(blockinfo[i].extranonce);
txCoinbase.vin[0].scriptSig.push_back(chainActive.Height()); txCoinbase.vin[0].scriptSig.push_back(chainActive.Height());

Loading…
Cancel
Save