diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-09-13 17:02:54 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-09-13 17:03:00 +0200 |
commit | c9914c2094686d69e5166b147f3b5a8ce09ae55e (patch) | |
tree | a5b361a3fd6e1f766048aee59137e4747c7f2ddc | |
parent | 7fe6c5c993706e8395cdaf7977bee793c06f48f3 (diff) | |
parent | 86c3f8db0bf64693313a81d5fe92ef603499030a (diff) |
Merge #8699: Remove createwitnessaddress RPC command
86c3f8d Remove createwitnessaddress (Johnson Lau)
-rw-r--r-- | src/rpc/misc.cpp | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index 2b5782367c..5afcf6353c 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -321,43 +321,6 @@ UniValue createmultisig(const UniValue& params, bool fHelp) return result; } -UniValue createwitnessaddress(const UniValue& params, bool fHelp) -{ - if (fHelp || params.size() < 1 || params.size() > 1) - { - string msg = "createwitnessaddress \"script\"\n" - "\nCreates a witness address for a particular script.\n" - "It returns a json object with the address and witness script.\n" - - "\nArguments:\n" - "1. \"script\" (string, required) A hex encoded script\n" - - "\nResult:\n" - "{\n" - " \"address\":\"multisigaddress\", (string) The value of the new address (P2SH of witness script).\n" - " \"witnessScript\":\"script\" (string) The string value of the hex-encoded witness script.\n" - "}\n" - ; - throw runtime_error(msg); - } - - if (!IsHex(params[0].get_str())) { - throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Script must be hex-encoded"); - } - - std::vector<unsigned char> code = ParseHex(params[0].get_str()); - CScript script(code.begin(), code.end()); - CScript witscript = GetScriptForWitness(script); - CScriptID witscriptid(witscript); - CBitcoinAddress address(witscriptid); - - UniValue result(UniValue::VOBJ); - result.push_back(Pair("address", address.ToString())); - result.push_back(Pair("witnessScript", HexStr(witscript.begin(), witscript.end()))); - - return result; -} - UniValue verifymessage(const UniValue& params, bool fHelp) { if (fHelp || params.size() != 3) @@ -493,7 +456,6 @@ static const CRPCCommand commands[] = { "control", "getinfo", &getinfo, true }, /* uses wallet if enabled */ { "util", "validateaddress", &validateaddress, true }, /* uses wallet if enabled */ { "util", "createmultisig", &createmultisig, true }, - { "util", "createwitnessaddress", &createwitnessaddress, true }, { "util", "verifymessage", &verifymessage, true }, { "util", "signmessagewithprivkey", &signmessagewithprivkey, true }, |