@@ -1862,87 +1862,6 @@ Value encryptwallet(const Array& params, bool fHelp)
1862
1862
return " wallet encrypted; Bitcoin server stopping, restart to run with encrypted wallet. The keypool has been flushed, you need to make a new backup." ;
1863
1863
}
1864
1864
1865
- class DescribeAddressVisitor : public boost ::static_visitor<Object>
1866
- {
1867
- public:
1868
- Object operator ()(const CNoDestination &dest) const { return Object (); }
1869
-
1870
- Object operator ()(const CKeyID &keyID) const {
1871
- Object obj;
1872
- CPubKey vchPubKey;
1873
- pwalletMain->GetPubKey (keyID, vchPubKey);
1874
- obj.push_back (Pair (" isscript" , false ));
1875
- obj.push_back (Pair (" pubkey" , HexStr (vchPubKey)));
1876
- obj.push_back (Pair (" iscompressed" , vchPubKey.IsCompressed ()));
1877
- return obj;
1878
- }
1879
-
1880
- Object operator ()(const CScriptID &scriptID) const {
1881
- Object obj;
1882
- obj.push_back (Pair (" isscript" , true ));
1883
- CScript subscript;
1884
- pwalletMain->GetCScript (scriptID, subscript);
1885
- std::vector<CTxDestination> addresses;
1886
- txnouttype whichType;
1887
- int nRequired;
1888
- ExtractDestinations (subscript, whichType, addresses, nRequired);
1889
- obj.push_back (Pair (" script" , GetTxnOutputType (whichType)));
1890
- obj.push_back (Pair (" hex" , HexStr (subscript.begin (), subscript.end ())));
1891
- Array a;
1892
- BOOST_FOREACH (const CTxDestination& addr, addresses)
1893
- a.push_back (CBitcoinAddress (addr).ToString ());
1894
- obj.push_back (Pair (" addresses" , a));
1895
- if (whichType == TX_MULTISIG)
1896
- obj.push_back (Pair (" sigsrequired" , nRequired));
1897
- return obj;
1898
- }
1899
- };
1900
-
1901
- Value validateaddress (const Array& params, bool fHelp )
1902
- {
1903
- if (fHelp || params.size () != 1 )
1904
- throw runtime_error (
1905
- " validateaddress \" bitcoinaddress\"\n "
1906
- " \n Return information about the given bitcoin address.\n "
1907
- " \n Arguments:\n "
1908
- " 1. \" bitcoinaddress\" (string, required) The bitcoin address to validate\n "
1909
- " \n Result:\n "
1910
- " {\n "
1911
- " \" isvalid\" : true|false, (boolean) If the address is valid or not. If not, this is the only property returned.\n "
1912
- " \" address\" : \" bitcoinaddress\" , (string) The bitcoin address validated\n "
1913
- " \" ismine\" : true|false, (boolean) If the address is yours or not\n "
1914
- " \" isscript\" : true|false, (boolean) If the key is a script\n "
1915
- " \" pubkey\" : \" publickeyhex\" , (string) The hex value of the raw public key\n "
1916
- " \" iscompressed\" : true|false, (boolean) If the address is compressed\n "
1917
- " \" account\" : \" account\" (string) The account associated with the address, \"\" is the default account\n "
1918
- " }\n "
1919
- " \n Examples:\n "
1920
- + HelpExampleCli (" validateaddress" , " \" 1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\" " )
1921
- + HelpExampleRpc (" validateaddress" , " \" 1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\" " )
1922
- );
1923
-
1924
- CBitcoinAddress address (params[0 ].get_str ());
1925
- bool isValid = address.IsValid ();
1926
-
1927
- Object ret;
1928
- ret.push_back (Pair (" isvalid" , isValid));
1929
- if (isValid)
1930
- {
1931
- CTxDestination dest = address.Get ();
1932
- string currentAddress = address.ToString ();
1933
- ret.push_back (Pair (" address" , currentAddress));
1934
- bool fMine = pwalletMain ? IsMine (*pwalletMain, dest) : false ;
1935
- ret.push_back (Pair (" ismine" , fMine ));
1936
- if (fMine ) {
1937
- Object detail = boost::apply_visitor (DescribeAddressVisitor (), dest);
1938
- ret.insert (ret.end (), detail.begin (), detail.end ());
1939
- }
1940
- if (pwalletMain && pwalletMain->mapAddressBook .count (dest))
1941
- ret.push_back (Pair (" account" , pwalletMain->mapAddressBook [dest].name ));
1942
- }
1943
- return ret;
1944
- }
1945
-
1946
1865
Value lockunspent (const Array& params, bool fHelp )
1947
1866
{
1948
1867
if (fHelp || params.size () < 1 || params.size () > 2 )
0 commit comments