Browse Source

add address and account information to listunspent

miguelfreitas
mb300sd 12 years ago
parent
commit
550479b09f
  1. 7
      src/rpcrawtransaction.cpp

7
src/rpcrawtransaction.cpp

@ -225,6 +225,13 @@ Value listunspent(const Array& params, bool fHelp) @@ -225,6 +225,13 @@ Value listunspent(const Array& params, bool fHelp)
Object entry;
entry.push_back(Pair("txid", out.tx->GetHash().GetHex()));
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())));
if (pk.IsPayToScriptHash())
{

Loading…
Cancel
Save