From 52fc39917fc52c2ff279fe434431e18900b347bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Barbosa?= Date: Mon, 12 Oct 2020 01:45:05 +0100 Subject: rpc: Reject empty txids in gettxoutproof --- src/rpc/rawtransaction.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/rpc') diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index f08e7ae998..1044350c53 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -245,6 +245,9 @@ static RPCHelpMan gettxoutproof() { std::set 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) { -- cgit v1.2.3