Closes #2446 by adding generated field to listunspent.
If generated is true, the unspent transaction output is from a coinbase transaction and can only be sent to a shielded address.
This commit is contained in:
@@ -2334,6 +2334,7 @@ UniValue listunspent(const UniValue& params, bool fHelp)
|
||||
" {\n"
|
||||
" \"txid\" : \"txid\", (string) the transaction id \n"
|
||||
" \"vout\" : n, (numeric) the vout value\n"
|
||||
" \"generated\" : true|false (boolean) true if txout is a coinbase transaction output\n"
|
||||
" \"address\" : \"address\", (string) the zcash address\n"
|
||||
" \"account\" : \"account\", (string) DEPRECATED. The associated account, or \"\" for the default account\n"
|
||||
" \"scriptPubKey\" : \"key\", (string) the script key\n"
|
||||
@@ -2396,6 +2397,7 @@ UniValue listunspent(const UniValue& params, bool fHelp)
|
||||
UniValue entry(UniValue::VOBJ);
|
||||
entry.push_back(Pair("txid", out.tx->GetHash().GetHex()));
|
||||
entry.push_back(Pair("vout", out.i));
|
||||
entry.push_back(Pair("generated", out.tx->IsCoinBase()));
|
||||
CTxDestination address;
|
||||
if (ExtractDestination(out.tx->vout[out.i].scriptPubKey, address)) {
|
||||
entry.push_back(Pair("address", CBitcoinAddress(address).ToString()));
|
||||
|
||||
Reference in New Issue
Block a user