mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-23 04:54:30 +00:00
Merge pull request #2282 from mb300sd/addressinlistunspent
Address in listunspent
This commit is contained in:
commit
96371bc6e0
@ -225,6 +225,13 @@ Value listunspent(const Array& params, bool fHelp)
|
|||||||
Object entry;
|
Object entry;
|
||||||
entry.push_back(Pair("txid", out.tx->GetHash().GetHex()));
|
entry.push_back(Pair("txid", out.tx->GetHash().GetHex()));
|
||||||
entry.push_back(Pair("vout", out.i));
|
entry.push_back(Pair("vout", out.i));
|
||||||
|
CTxDestination address;
|
||||||
|
if (ExtractDestination(out.tx->vout[out.i].scriptPubKey, address))
|
||||||
|
{
|
||||||
|
entry.push_back(Pair("address", CBitcoinAddress(address).ToString()));
|
||||||
|
if (pwalletMain->mapAddressBook.count(address))
|
||||||
|
entry.push_back(Pair("account", pwalletMain->mapAddressBook[address]));
|
||||||
|
}
|
||||||
entry.push_back(Pair("scriptPubKey", HexStr(pk.begin(), pk.end())));
|
entry.push_back(Pair("scriptPubKey", HexStr(pk.begin(), pk.end())));
|
||||||
if (pk.IsPayToScriptHash())
|
if (pk.IsPayToScriptHash())
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user