diff --git a/rpc.cpp b/rpc.cpp index 1c6f228e5..dd94acc05 100644 --- a/rpc.cpp +++ b/rpc.cpp @@ -381,6 +381,12 @@ Value setaccount(const Array& params, bool fHelp) "Sets the account associated with the given address."); string strAddress = params[0].get_str(); + uint160 hash160; + bool isValid = AddressToHash160(strAddress, hash160); + if (!isValid) + throw JSONRPCError(-5, "Invalid bitcoin address"); + + string strAccount; if (params.size() > 1) strAccount = AccountFromValue(params[1]);