Changeset View
Changeset View
Standalone View
Standalone View
src/miner.cpp
Show First 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | BlockAssembler::CreateNewBlock(const CScript &scriptPubKeyIn) { | ||||
int64_t nTime1 = GetTimeMicros(); | int64_t nTime1 = GetTimeMicros(); | ||||
nLastBlockTx = nBlockTx; | nLastBlockTx = nBlockTx; | ||||
nLastBlockSize = nBlockSize; | nLastBlockSize = nBlockSize; | ||||
// Create coinbase transaction. | // Create coinbase transaction. | ||||
CMutableTransaction coinbaseTx; | CMutableTransaction coinbaseTx; | ||||
coinbaseTx.vin.resize(1); | coinbaseTx.vin.resize(1); | ||||
coinbaseTx.vin[0].prevout.SetNull(); | coinbaseTx.vin[0].prevout = COutPoint(); | ||||
coinbaseTx.vout.resize(1); | coinbaseTx.vout.resize(1); | ||||
coinbaseTx.vout[0].scriptPubKey = scriptPubKeyIn; | coinbaseTx.vout[0].scriptPubKey = scriptPubKeyIn; | ||||
coinbaseTx.vout[0].nValue = | coinbaseTx.vout[0].nValue = | ||||
nFees + GetBlockSubsidy(nHeight, chainparams.GetConsensus()); | nFees + GetBlockSubsidy(nHeight, chainparams.GetConsensus()); | ||||
coinbaseTx.vin[0].scriptSig = CScript() << nHeight << OP_0; | coinbaseTx.vin[0].scriptSig = CScript() << nHeight << OP_0; | ||||
pblock->vtx[0] = MakeTransactionRef(coinbaseTx); | pblock->vtx[0] = MakeTransactionRef(coinbaseTx); | ||||
pblocktemplate->vTxFees[0] = -1 * nFees; | pblocktemplate->vTxFees[0] = -1 * nFees; | ||||
▲ Show 20 Lines • Show All 469 Lines • Show Last 20 Lines |