Author

Topic: destination address of a mined block (Read 3011 times)

sr. member
Activity: 403
Merit: 251
October 16, 2013, 10:27:51 AM
#5
How to obtain destination address of a mined block?

If the block is already mined, you could re-use code from 'getblock' and 'getrawtransaction'.
(shows address of a mined block in plain text if verbose==1,
block reward is usually (not sure if always) the 1st tx in the list from 'getblock')

legendary
Activity: 905
Merit: 1012
October 15, 2013, 02:19:35 PM
#4
It uses a public key from your reserved key pool, in a public-key script (NOT a pubkey-hash script -- there is no address which specifies this script type used in coinbase transactions). You can use 'getblocktemplate' to construct your own coinbase, with whatever script you desire.
full member
Activity: 206
Merit: 102
step forward
October 15, 2013, 01:06:00 PM
#3
In bitcoin-qt, seems that each mined block goes to new bitcoin address, first transaction output (mined block).
I was searching for "default address" for mined blocks, but do not seems possible. Createnewblock should be modified for this.


legendary
Activity: 905
Merit: 1012
October 15, 2013, 11:05:21 AM
#2
Coinbase outputs, as implemented by the reference client, are not one of the standard address formats.

What is your question, exactly?
full member
Activity: 206
Merit: 102
step forward
October 12, 2013, 01:57:38 PM
#1
How to obtain destination address of a mined block?

Similar to out address:
Code:
        const CTxOut& txout = tx.vout[0];
        txnouttype type;
        vector addresses;
        int nRequired;

        if (ExtractDestinations(txout.scriptPubKey, type, addresses, nRequired)){
            BOOST_FOREACH(const CTxDestination& addr, addresses){
            printf("out_address:%s\n",CBitcoinAddress(addr).ToString().c_str());
         }
Jump to: