Changeset View
Changeset View
Standalone View
Standalone View
src/test/test_bitcoin.cpp
Show First 20 Lines • Show All 149 Lines • ▼ Show 20 Lines | TestChain100Setup::TestChain100Setup() | ||||
: TestingSetup(CBaseChainParams::REGTEST) { | : TestingSetup(CBaseChainParams::REGTEST) { | ||||
// Generate a 100-block chain: | // Generate a 100-block chain: | ||||
coinbaseKey.MakeNewKey(true); | coinbaseKey.MakeNewKey(true); | ||||
CScript scriptPubKey = CScript() << ToByteVector(coinbaseKey.GetPubKey()) | CScript scriptPubKey = CScript() << ToByteVector(coinbaseKey.GetPubKey()) | ||||
<< OP_CHECKSIG; | << OP_CHECKSIG; | ||||
for (int i = 0; i < COINBASE_MATURITY; i++) { | for (int i = 0; i < COINBASE_MATURITY; i++) { | ||||
std::vector<CMutableTransaction> noTxns; | std::vector<CMutableTransaction> noTxns; | ||||
CBlock b = CreateAndProcessBlock(noTxns, scriptPubKey); | CBlock b = CreateAndProcessBlock(noTxns, scriptPubKey); | ||||
coinbaseTxns.push_back(*b.vtx[0]); | m_coinbase_txns.push_back(*b.vtx[0]); | ||||
} | } | ||||
} | } | ||||
// | // | ||||
// Create a new block with just given transactions, coinbase paying to | // Create a new block with just given transactions, coinbase paying to | ||||
// scriptPubKey, and try to add it to the current chain. | // scriptPubKey, and try to add it to the current chain. | ||||
// | // | ||||
CBlock TestChain100Setup::CreateAndProcessBlock( | CBlock TestChain100Setup::CreateAndProcessBlock( | ||||
▲ Show 20 Lines • Show All 125 Lines • Show Last 20 Lines |