From 0e3d7c5ee16d5a4c061ab9a57285bceb7899b512 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Wed, 8 Dec 2021 19:17:29 +0700 Subject: refactor: drop redundant hash argument from FetchBlock --- src/net_processing.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/net_processing.h') diff --git a/src/net_processing.h b/src/net_processing.h index 6c18e8ddfa..2b22d8ce85 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -45,12 +45,11 @@ public: /** * Attempt to manually fetch block from a given peer. We must already have the header. * - * @param[in] id The peer id - * @param[in] hash The block hash - * @param[in] pindex The blockindex - * @returns Whether a request was successfully made + * @param[in] id The peer id + * @param[in] block_index The blockindex + * @returns Whether a request was successfully made */ - virtual bool FetchBlock(NodeId id, const uint256& hash, const CBlockIndex& pindex) = 0; + virtual bool FetchBlock(NodeId id, const CBlockIndex& block_index) = 0; /** Begin running background tasks, should only be called once */ virtual void StartScheduledTasks(CScheduler& scheduler) = 0; -- cgit v1.2.3 From 34d5399211eeb61e7e7961c301fb2ddea8aa3f6a Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Wed, 8 Dec 2021 20:16:36 +0700 Subject: rpc: more detailed errors for getblockfrompeer --- src/net_processing.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/net_processing.h') diff --git a/src/net_processing.h b/src/net_processing.h index 2b22d8ce85..2c8ae05a26 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -47,9 +47,9 @@ public: * * @param[in] id The peer id * @param[in] block_index The blockindex - * @returns Whether a request was successfully made + * @returns std::nullopt if a request was successfully made, otherwise an error message */ - virtual bool FetchBlock(NodeId id, const CBlockIndex& block_index) = 0; + virtual std::optional FetchBlock(NodeId id, const CBlockIndex& block_index) = 0; /** Begin running background tasks, should only be called once */ virtual void StartScheduledTasks(CScheduler& scheduler) = 0; -- cgit v1.2.3 From 923312fbf6a89efde1739da0b7209694d4f892ba Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Fri, 10 Dec 2021 20:12:05 +0700 Subject: rpc: use peer_id, block_hash for FetchBlock --- src/net_processing.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/net_processing.h') diff --git a/src/net_processing.h b/src/net_processing.h index 2c8ae05a26..c30ce056fa 100644 --- a/src/net_processing.h +++ b/src/net_processing.h @@ -45,11 +45,11 @@ public: /** * Attempt to manually fetch block from a given peer. We must already have the header. * - * @param[in] id The peer id + * @param[in] peer_id The peer id * @param[in] block_index The blockindex * @returns std::nullopt if a request was successfully made, otherwise an error message */ - virtual std::optional FetchBlock(NodeId id, const CBlockIndex& block_index) = 0; + virtual std::optional FetchBlock(NodeId peer_id, const CBlockIndex& block_index) = 0; /** Begin running background tasks, should only be called once */ virtual void StartScheduledTasks(CScheduler& scheduler) = 0; -- cgit v1.2.3