Connect mined blocks with various addresses

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?

user1497250

Posted 2013-09-04T20:41:14.400

Reputation: 181

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 2013-09-04T22:23:16.410

Yes. Send part of getblockvalue() to selected address.user1497250 2013-09-05T09:58:33.007

Answers

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

Neil Neyman

Posted 2013-09-04T20:41:14.400

Reputation: 598