diff options
author | João Barbosa <joao.paulo.barbosa@gmail.com> | 2020-10-12 01:45:05 +0100 |
---|---|---|
committer | João Barbosa <joao.paulo.barbosa@gmail.com> | 2020-12-04 18:38:23 +0000 |
commit | 52fc39917fc52c2ff279fe434431e18900b347bd (patch) | |
tree | 2bdb3398b4cbd4f32e1bc82d59b97631922c53f4 /src/rpc | |
parent | 73dc19a330f8cb063af46e6c4246f2e64a04bdc1 (diff) | |
download | bitcoin-52fc39917fc52c2ff279fe434431e18900b347bd.tar.xz |
rpc: Reject empty txids in gettxoutproof
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/rawtransaction.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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<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) { |