0

From code:

 // Create coinbase tx
 CTransaction txNew;
 txNew.vin.resize(1);
 txNew.vin[0].prevout.SetNull();
 txNew.vout.resize(1);
 CPubKey pubkey;
 if (!reservekey.GetReservedKey(pubkey))
     return NULL;
 txNew.vout[0].scriptPubKey << pubkey << OP_CHECKSIG;

 // Add our coinbase tx as first transaction
 pblock->vtx.push_back(txNew);
 pblocktemplate->vTxFees.push_back(-1); // updated at end
 pblocktemplate->vTxSigOps.push_back(-1); // updated at end

How I can connect mined blocks with various addresses in base58? Not only with miner address.

I want send part of mined value to one address (developer fund), different of miner address.

add vtx[1]? Only check it in connectblock and createnewblock functions?

  • I am not sure I understand what you are asking: Is this question about how to send the mining reward to more than one address? – Murch Sep 4 '13 at 22:23
  • Yes. Send part of getblockvalue() to selected address. – user1497250 Sep 5 '13 at 9:58
1

This isn't a complete answer but I might be able to point you in the right direction:

It seems like you have:

CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)

So you're taking a CScript as a parameter. Some additional relevant links. I think you would either use that to create multiple outputs, or you would use

txNew.vout[1];

Also see how they do it here: - https://dev.visucore.com/bitcoin/doxygen/miner__tests_8cpp_source.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.