Add equivalent check to validate admin endpoint (#131)
Some checks failed
unix-ci / build-tests (macos-12, WITH_RMQ=OFF) (push) Has been cancelled
unix-ci / build-tests (macos-12, WITH_RMQ=ON) (push) Has been cancelled
unix-ci / build-tests (macos-13, WITH_RMQ=OFF) (push) Has been cancelled
unix-ci / build-tests (macos-13, WITH_RMQ=ON) (push) Has been cancelled
unix-ci / build-tests (macos-latest, WITH_RMQ=OFF) (push) Has been cancelled
unix-ci / build-tests (macos-latest, WITH_RMQ=ON) (push) Has been cancelled
unix-ci / build-tests (ubuntu-20.04, WITH_RMQ=OFF) (push) Has been cancelled
unix-ci / build-tests (ubuntu-20.04, WITH_RMQ=ON) (push) Has been cancelled
unix-ci / build-tests (ubuntu-22.04, WITH_RMQ=OFF) (push) Has been cancelled
unix-ci / build-tests (ubuntu-22.04, WITH_RMQ=ON) (push) Has been cancelled
unix-ci / build-tests (ubuntu-latest, WITH_RMQ=OFF) (push) Has been cancelled
unix-ci / build-tests (ubuntu-latest, WITH_RMQ=ON) (push) Has been cancelled

This commit is contained in:
Lee *!* Clagett 2024-09-10 14:46:21 -04:00 committed by Lee *!* Clagett
parent 24e6c2f5f3
commit 64dd5d1aa9

View file

@ -288,8 +288,14 @@ namespace lws { namespace rpc
db::account_address address{};
crypto::secret_key view_key{};
if (!convert_key(dest, address.spend_public, req.spend_public_hex, "spend_public_hex"))
if (req.spend_public_hex == req.view_public_hex)
{
output_error(dest, "spend_public_hex", "spend_public_hex and view_public_hex should not be equal");
return success(); // error is delivered in JSON as opposed to HTTP codes
}
if (!convert_key(dest, address.spend_public, req.spend_public_hex, "spend_public_hex"))
return success();
if (!convert_key(dest, address.view_public, req.view_public_hex, "view_public_hex"))
return success();
if (!convert_key(dest, unwrap(unwrap(view_key)), req.view_key_hex, "view_key_hex"))