aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2022-04-22 11:11:39 +0200
committerJon Atack <jon@atack.com>2022-06-27 13:03:24 +0200
commit2ef5294a5bb68ceb3797d2638567a172cc21699f (patch)
tree27a7e42c318b4564af6377181757bb9e4140f811 /src
parent734b9669ff7b2f5e2820993443a6f868f6b0b20a (diff)
rpc: add RPCTypeCheck for getblockfrompeer inputs
Diffstat (limited to 'src')
-rw-r--r--src/rpc/blockchain.cpp5
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);