@@ -321,43 +321,6 @@ UniValue createmultisig(const UniValue& params, bool fHelp)
321321 return result;
322322}
323323
324- UniValue createwitnessaddress (const UniValue& params, bool fHelp )
325- {
326- if (fHelp || params.size () < 1 || params.size () > 1 )
327- {
328- string msg = " createwitnessaddress \" script\"\n "
329- " \n Creates a witness address for a particular script.\n "
330- " It returns a json object with the address and witness script.\n "
331-
332- " \n Arguments:\n "
333- " 1. \" script\" (string, required) A hex encoded script\n "
334-
335- " \n Result:\n "
336- " {\n "
337- " \" address\" :\" multisigaddress\" , (string) The value of the new address (P2SH of witness script).\n "
338- " \" witnessScript\" :\" script\" (string) The string value of the hex-encoded witness script.\n "
339- " }\n "
340- ;
341- throw runtime_error (msg);
342- }
343-
344- if (!IsHex (params[0 ].get_str ())) {
345- throw JSONRPCError (RPC_INVALID_ADDRESS_OR_KEY, " Script must be hex-encoded" );
346- }
347-
348- std::vector<unsigned char > code = ParseHex (params[0 ].get_str ());
349- CScript script (code.begin (), code.end ());
350- CScript witscript = GetScriptForWitness (script);
351- CScriptID witscriptid (witscript);
352- CBitcoinAddress address (witscriptid);
353-
354- UniValue result (UniValue::VOBJ);
355- result.push_back (Pair (" address" , address.ToString ()));
356- result.push_back (Pair (" witnessScript" , HexStr (witscript.begin (), witscript.end ())));
357-
358- return result;
359- }
360-
361324UniValue verifymessage (const UniValue& params, bool fHelp )
362325{
363326 if (fHelp || params.size () != 3 )
@@ -493,7 +456,6 @@ static const CRPCCommand commands[] =
493456 { " control" , " getinfo" , &getinfo, true }, /* uses wallet if enabled */
494457 { " util" , " validateaddress" , &validateaddress, true }, /* uses wallet if enabled */
495458 { " util" , " createmultisig" , &createmultisig, true },
496- { " util" , " createwitnessaddress" , &createwitnessaddress, true },
497459 { " util" , " verifymessage" , &verifymessage, true },
498460 { " util" , " signmessagewithprivkey" , &signmessagewithprivkey, true },
499461
0 commit comments