|
|
@ -3929,25 +3929,17 @@ CBlockTemplate* CreateNewBlock(CReserveKey& reservekey) |
|
|
|
|
|
|
|
|
|
|
|
// Create coinbase tx
|
|
|
|
// Create coinbase tx
|
|
|
|
CTransaction txNew; |
|
|
|
CTransaction txNew; |
|
|
|
/* [MF]
|
|
|
|
|
|
|
|
txNew.vin.resize(1); |
|
|
|
|
|
|
|
txNew.vin[0].prevout.SetNull(); |
|
|
|
|
|
|
|
txNew.vout.resize(1); |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
txNew.message.clear(); |
|
|
|
txNew.message.clear(); |
|
|
|
|
|
|
|
|
|
|
|
/* [MF] Check! add spam */ |
|
|
|
/* [MF] Check! add spam */ |
|
|
|
CPubKey pubkey; |
|
|
|
CPubKey pubkey; |
|
|
|
if (!reservekey.GetReservedKey(pubkey)) |
|
|
|
if (!reservekey.GetReservedKey(pubkey)) |
|
|
|
return NULL; |
|
|
|
return NULL; |
|
|
|
txNew.pubKey << pubkey << OP_CHECKSIG; |
|
|
|
txNew.pubKey << pubkey << OP_CHECKSIG; |
|
|
|
|
|
|
|
txNew.nNonce = 0; |
|
|
|
// [MF] TODO: fix nNonce
|
|
|
|
// [MF] TODO: fix nNonce
|
|
|
|
|
|
|
|
|
|
|
|
// Add our coinbase tx as first transaction
|
|
|
|
// Add our coinbase tx as first transaction
|
|
|
|
pblock->vtx.push_back(txNew); |
|
|
|
pblock->vtx.push_back(txNew); |
|
|
|
pblocktemplate->vTxFees.push_back(-1); // updated at end
|
|
|
|
|
|
|
|
pblocktemplate->vTxSigOps.push_back(-1); // updated at end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Largest block you're willing to create:
|
|
|
|
// Largest block you're willing to create:
|
|
|
|
unsigned int nBlockMaxSize = GetArg("-blockmaxsize", MAX_BLOCK_SIZE_GEN/2); |
|
|
|
unsigned int nBlockMaxSize = GetArg("-blockmaxsize", MAX_BLOCK_SIZE_GEN/2); |
|
|
@ -4040,11 +4032,10 @@ void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& |
|
|
|
hashPrevBlock = pblock->hashPrevBlock; |
|
|
|
hashPrevBlock = pblock->hashPrevBlock; |
|
|
|
} |
|
|
|
} |
|
|
|
++nExtraNonce; |
|
|
|
++nExtraNonce; |
|
|
|
unsigned int nHeight = pindexPrev->nHeight+1; // Height first in coinbase required for block.version=2
|
|
|
|
pblock->nHeight = pindexPrev->nHeight+1; |
|
|
|
/* [MF] Check!
|
|
|
|
/* extra nonce added to spamMessage.pubKey */ |
|
|
|
pblock->vtx[0].vin[0].scriptSig = (CScript() << nHeight << CBigNum(nExtraNonce)) + COINBASE_FLAGS; |
|
|
|
pblock->vtx[0].pubKey = (CScript() << CBigNum(nExtraNonce)) + COINBASE_FLAGS; |
|
|
|
assert(pblock->vtx[0].vin[0].scriptSig.size() <= 100); |
|
|
|
assert(pblock->vtx[0].pubKey.size() <= 100); |
|
|
|
*/ |
|
|
|
|
|
|
|
pblock->hashMerkleRoot = pblock->BuildMerkleTree(); |
|
|
|
pblock->hashMerkleRoot = pblock->BuildMerkleTree(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|