aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2023-03-10 14:18:31 +0100
committerfanquake <fanquake@gmail.com>2023-03-10 14:25:00 +0100
commit6e662a89851c66a390efdab4a42c7bdac86b3cd9 (patch)
treeb2058c4a17205644e71a182e0d746b37cdb40922 /src
parentf7bdcfc83f5753349018be3b5a663c8923d1a5eb (diff)
parentfe329dc936d1e02da406345e4223e11d1fa6fb38 (diff)
Merge bitcoin/bitcoin#23813: Add test and docs for getblockfrompeer with pruning
fe329dc936d1e02da406345e4223e11d1fa6fb38 test: Add test for getblockfrompeer on pruned nodes (Fabian Jahr) cd761e6b2cfade038b8018886c334bf25a0bcbcf rpc: Add note on guarantees to getblockfrompeer (Fabian Jahr) Pull request description: These are additions to `getblockfrompeer` that I already [suggested on the original PR](https://github.com/bitcoin/bitcoin/pull/20295#pullrequestreview-817157738). The two commits do the following: 1. Add a test for `getblockfrompeer` usage on pruned nodes. This is important because many use-cases for `getblockfrompeer` are in a context of a pruned node. 2. Add some information on how long the users of pruned nodes can expect the block to be available after they have used the RPC. I think the behavior is not very intuitive for users and I would not be surprised if users expect the block to be available indefinitely. ACKs for top commit: Sjors: re-utACK fe329dc936d1e02da406345e4223e11d1fa6fb38 MarcoFalke: review ACK fe329dc936d1e02da406345e4223e11d1fa6fb38 🍉 stratospher: ACK fe329dc. brunoerg: re-ACK fe329dc936d1e02da406345e4223e11d1fa6fb38 Tree-SHA512: a686bd8955d9c3baf365db384e497d6ee1aa9ce2fdb0733fe6150f7e3d94bae19d55bc1b347f1c9f619e749e18b41a52b9f8c0aa2042dd311a968a4b5d251fac
Diffstat (limited to 'src')
-rw-r--r--src/rpc/blockchain.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp
index 9459801c2c..5afa460075 100644
--- a/src/rpc/blockchain.cpp
+++ b/src/rpc/blockchain.cpp
@@ -432,7 +432,8 @@ static RPCHelpMan getblockfrompeer()
"We must have the header for this block, e.g. using submitheader.\n"
"Subsequent calls for the same block and a new peer will cause the response from the previous peer to be ignored.\n"
"Peers generally ignore requests for a stale block that they never fully verified, or one that is more than a month old.\n"
- "When a peer does not respond with a block, we will disconnect.\n\n"
+ "When a peer does not respond with a block, we will disconnect.\n"
+ "Note: The block could be re-pruned as soon as it is received.\n\n"
"Returns an empty JSON object if the request was successfully scheduled.",
{
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash to try to fetch"},