diff options
Diffstat (limited to 'src/rpcmisc.cpp')
-rw-r--r-- | src/rpcmisc.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index b8805b9d51..184aacf5a8 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -23,8 +23,6 @@ #include "json/json_spirit_utils.h" #include "json/json_spirit_value.h" -using namespace boost; -using namespace boost::assign; using namespace json_spirit; using namespace std; @@ -162,6 +160,7 @@ Value validateaddress(const Array& params, bool fHelp) "{\n" " \"isvalid\" : true|false, (boolean) If the address is valid or not. If not, this is the only property returned.\n" " \"address\" : \"bitcoinaddress\", (string) The bitcoin address validated\n" + " \"scriptPubKey\" : \"hex\", (string) The hex encoded scriptPubKey generated by the address\n" " \"ismine\" : true|false, (boolean) If the address is yours or not\n" " \"isscript\" : true|false, (boolean) If the key is a script\n" " \"pubkey\" : \"publickeyhex\", (string) The hex value of the raw public key\n" @@ -183,6 +182,10 @@ Value validateaddress(const Array& params, bool fHelp) CTxDestination dest = address.Get(); string currentAddress = address.ToString(); ret.push_back(Pair("address", currentAddress)); + + CScript scriptPubKey = GetScriptForDestination(dest); + ret.push_back(Pair("scriptPubKey", HexStr(scriptPubKey.begin(), scriptPubKey.end()))); + #ifdef ENABLE_WALLET isminetype mine = pwalletMain ? IsMine(*pwalletMain, dest) : ISMINE_NO; ret.push_back(Pair("ismine", (mine & ISMINE_SPENDABLE) ? true : false)); |