diff options
| author | Gregory Maxwell <[email protected]> | 2013-04-07 14:44:19 -0700 |
|---|---|---|
| committer | Gregory Maxwell <[email protected]> | 2013-04-07 14:44:19 -0700 |
| commit | 96371bc6e01e2bf9a6d78b92860160fb6ffd2180 (patch) | |
| tree | 4f90d4569f8b68981e7d60abe5f280da09eadfd8 /src | |
| parent | Merge pull request #2482 from Diapolo/TX-pull (diff) | |
| parent | add address and account information to listunspent (diff) | |
| download | discoin-96371bc6e01e2bf9a6d78b92860160fb6ffd2180.tar.xz discoin-96371bc6e01e2bf9a6d78b92860160fb6ffd2180.zip | |
Merge pull request #2282 from mb300sd/addressinlistunspent
Address in listunspent
Diffstat (limited to 'src')
| -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 bbaf40c73..fb9811b92 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()) { |