aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/blockchain.cpp
diff options
context:
space:
mode:
authorSjors Provoost <sjors@sprovoost.nl>2021-12-08 19:17:29 +0700
committerSjors Provoost <sjors@sprovoost.nl>2021-12-24 16:28:53 +0100
commit0e3d7c5ee16d5a4c061ab9a57285bceb7899b512 (patch)
tree6b99fdec1acf9cb787db61f0a8c1d1cab2e5e556 /src/rpc/blockchain.cpp
parent8d1a3e6498de6087501969a9d243b0697ca3fe97 (diff)
downloadbitcoin-0e3d7c5ee16d5a4c061ab9a57285bceb7899b512.tar.xz
refactor: drop redundant hash argument from FetchBlock
Diffstat (limited to 'src/rpc/blockchain.cpp')
-rw-r--r--src/rpc/blockchain.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp
index 22455058bd..c6c88f5057 100644
--- a/src/rpc/blockchain.cpp
+++ b/src/rpc/blockchain.cpp
@@ -801,9 +801,8 @@ static RPCHelpMan getblockfrompeer()
PeerManager& peerman = EnsurePeerman(node);
CConnman& connman = EnsureConnman(node);
- uint256 hash(ParseHashV(request.params[0], "hash"));
-
- const NodeId nodeid = static_cast<NodeId>(request.params[1].get_int64());
+ const uint256 hash(ParseHashV(request.params[0], "hash"));
+ const NodeId nodeid{request.params[1].get_int64()};
// Check that the peer with nodeid exists
if (!connman.ForNode(nodeid, [](CNode* node) {return true;})) {
@@ -820,7 +819,7 @@ static RPCHelpMan getblockfrompeer()
if (index->nStatus & BLOCK_HAVE_DATA) {
result.pushKV("warnings", "Block already downloaded");
- } else if (!peerman.FetchBlock(nodeid, hash, *index)) {
+ } else if (!peerman.FetchBlock(nodeid, *index)) {
throw JSONRPCError(RPC_MISC_ERROR, "Failed to fetch block from peer");
}
return result;