rpc: Reject empty txids in gettxoutproof

This commit is contained in:
João Barbosa
2020-10-12 01:45:05 +01:00
parent 73dc19a330
commit 52fc39917f
2 changed files with 4 additions and 1 deletions

View File

@@ -245,6 +245,9 @@ static RPCHelpMan gettxoutproof()
{
std::set<uint256> setTxids;
UniValue txids = request.params[0].get_array();
if (txids.empty()) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Parameter 'txids' cannot be empty");
}
for (unsigned int idx = 0; idx < txids.size(); idx++) {
auto ret = setTxids.insert(ParseHashV(txids[idx], "txid"));
if (!ret.second) {