Accept blank string as placeholder for change address in restricted asset RPC calls
@@ -159,11 +159,13 @@ UniValue UpdateAddressTag(const JSONRPCRequest &request, const int8_t &flag)
std::string change_address = "";
if (request.params.size() > 2) {
change_address = request.params[2].get_str();
+ if (!change_address.empty()) {
CTxDestination change_dest = DecodeDestination(change_address);
if (!IsValidDestination(change_dest)) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, std::string("Invalid Raven change address: ") + change_address);
}
}
+ }
// Get the optional asset data
std::string asset_data = "";
@@ -257,11 +259,13 @@ UniValue UpdateAddressRestriction(const JSONRPCRequest &request, const int8_t &f
std::string change_address = "";
if (request.params.size() > 2) {
change_address = request.params[2].get_str();
+ if (!change_address.empty()) {
CTxDestination change_dest = DecodeDestination(change_address);
if (!IsValidDestination(change_dest)) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, std::string("Invalid Raven change address: ") + change_address);
}
}
+ }
// Get the optional asset data
std::string asset_data = "";
@@ -352,11 +356,13 @@ UniValue UpdateGlobalRestrictedAsset(const JSONRPCRequest &request, const int8_t
std::string change_address = "";
if (request.params.size() > 1) {
change_address = request.params[1].get_str();
+ if (!change_address.empty()) {
CTxDestination change_dest = DecodeDestination(change_address);
if (!IsValidDestination(change_dest)) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, std::string("Invalid Raven change address: ") + change_address);
}
}
+ }
// Get the optional asset data
std::string asset_data = "";
