Skip to content

Commit

Permalink
Add Address to listunspent rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
Tranz5 committed May 21, 2014
1 parent b6f052b commit fca0554
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/rpcrawtransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,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())));
entry.push_back(Pair("amount",ValueFromAmount(nValue)));
entry.push_back(Pair("confirmations",out.nDepth));
Expand Down

0 comments on commit fca0554

Please sign in to comment.