diff options
author | mb300sd <mb300sd@github> | 2013-02-27 22:12:14 -0500 |
---|---|---|
committer | mb300sd <mb300sd@github> | 2013-02-27 22:13:43 -0500 |
commit | 550479b09f1a2bacc5a5fe2b9259baaa3c05029e (patch) | |
tree | 3585222756e2f909b89075e64b41dc1cc463d42b /src/rpcrawtransaction.cpp | |
parent | 65497f4ee77166ba2a803c51893a4eb5a401fdb9 (diff) |
add address and account information to listunspent
Diffstat (limited to 'src/rpcrawtransaction.cpp')
-rw-r--r-- | src/rpcrawtransaction.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index bbaf40c735..fb9811b921 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -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()) { |