diff options
author | Jon Atack <jon@atack.com> | 2022-04-22 11:11:39 +0200 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2022-06-27 13:03:24 +0200 |
commit | 2ef5294a5bb68ceb3797d2638567a172cc21699f (patch) | |
tree | 27a7e42c318b4564af6377181757bb9e4140f811 /src | |
parent | 734b9669ff7b2f5e2820993443a6f868f6b0b20a (diff) | |
download | bitcoin-2ef5294a5bb68ceb3797d2638567a172cc21699f.tar.xz |
rpc: add RPCTypeCheck for getblockfrompeer inputs
Diffstat (limited to 'src')
-rw-r--r-- | src/rpc/blockchain.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index f46e5e9fef..659e9dcd6a 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -439,6 +439,11 @@ static RPCHelpMan getblockfrompeer() }, [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue { + RPCTypeCheck(request.params, { + UniValue::VSTR, // blockhash + UniValue::VNUM, // peer_id + }); + const NodeContext& node = EnsureAnyNodeContext(request.context); ChainstateManager& chainman = EnsureChainman(node); PeerManager& peerman = EnsurePeerman(node); |