bitcoinz
bitcoinz copied to clipboard
Add founderaddress to gbt
Hi,
The founder reward amount is listed in getblocktemplate however the current address is not. Can you please add this into the gbt results?
Thanks
Hi, yes this can be added in the getblocktemplate
result, implemented as following into mining.cpp
:
- Including the key_io library :
#include "key_io.h"
- And getting back the address from the public script (just after the foundersreward pair):
const CScript & scriptPublicKey = tx.vout[1].scriptPubKey ;
std::vector<CTxDestination> addresses;
txnouttype whichType;
int nRequired;
ExtractDestinations(scriptPublicKey, whichType, addresses, nRequired);
//entry.push_back(Pair("script", GetTxnOutputType(whichType)));
//entry.push_back(Pair("hex", HexStr(scriptPublicKey.begin(), scriptPublicKey.end())));
UniValue a(UniValue::VARR);
for (const CTxDestination& addr : addresses) {a.push_back(EncodeDestination(addr));}
entry.push_back(Pair("foundersraddress", a));
This can be added in the 2.1.0 update :
And here the result :
thanks so much! makes it much easier to pickup the founder address changes.
Added into 2.0.8 release !