aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2022-01-25 18:48:35 +0100
committerMarcoFalke <falke.marco@gmail.com>2022-01-25 18:48:41 +0100
commit39d9bbe4acd7441aa9a61c57b76d887c4225a0e2 (patch)
tree781111b1b70aea1b3c1a5054f2827e0a1691b6ed /src/net_processing.h
parentb94d0c7af11bd91dad4f180ce2a2ffa09e4b5668 (diff)
parent923312fbf6a89efde1739da0b7209694d4f892ba (diff)
downloadbitcoin-39d9bbe4acd7441aa9a61c57b76d887c4225a0e2.tar.xz
Merge bitcoin/bitcoin#23706: rpc: getblockfrompeer followups
923312fbf6a89efde1739da0b7209694d4f892ba rpc: use peer_id, block_hash for FetchBlock (Sjors Provoost) 34d5399211eeb61e7e7961c301fb2ddea8aa3f6a rpc: more detailed errors for getblockfrompeer (Sjors Provoost) 60243cac7286e4c4bdda7094bef4cf6d1564b583 rpc: turn already downloaded into error in getblockfrompeer (Sjors Provoost) 809d66bb65aa78048e27c2a878d6f7becaecfe11 rpc: clarify getblockfrompeer behavior when called multiple times (Sjors Provoost) 0e3d7c5ee16d5a4c061ab9a57285bceb7899b512 refactor: drop redundant hash argument from FetchBlock (Sjors Provoost) 8d1a3e6498de6087501969a9d243b0697ca3fe97 rpc: allow empty JSON object result (Sjors Provoost) bfbf91d0b2004dde358253ac174982f784b43b59 test: fancier Python for getblockfrompeer (Sjors Provoost) Pull request description: Followups from #20295. ACKs for top commit: jonatack: ACK 923312fbf6a89efde1739da0b7209694d4f892ba :package: fjahr: tested ACK 923312fbf6a89efde1739da0b7209694d4f892ba Tree-SHA512: da9eca76e302e249409c9d7f0d16cca668ed981e2ab6ca2d1743dad0d830b94b1bc5ffb9028a00764b863201945c273cc8f4409a4c9ca3817830007dffa2bc20
Diffstat (limited to 'src/net_processing.h')
-rw-r--r--src/net_processing.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/net_processing.h b/src/net_processing.h
index 27775cea97..e30f9f516c 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] 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 bool FetchBlock(NodeId id, const uint256& hash, const CBlockIndex& pindex) = 0;
+ virtual std::optional<std::string> FetchBlock(NodeId peer_id, const CBlockIndex& block_index) = 0;
/** Begin running background tasks, should only be called once */
virtual void StartScheduledTasks(CScheduler& scheduler) = 0;