rpc: fetch block from peer #20155

issue Sjors openend this issue on October 15, 2020
  1. Sjors commented at 12:56 pm on October 15, 2020: member

    The node is very efficient at not downloading blocks it doesn’t care about. E.g. if a peer has headers for a lower proof-of-work branch, we won’t fetch the full block. It’ll appear as headers-only or valid-headers in getchaintips.

    This is fine, but if a user is curious about a block, there’s no easy way to obtain it.

    1. you can call invalidateblock on the current tip and wait for the node to jump to the other branch
    2. you can use some other software to obtain the block via p2p and then feed it to the node with submitblock

    It would be nice if you can just fetch it from a peer, if you know they have it. In the most simple implementation, the user has to specify which node to ask. A more fancy version could automatically try all nodes, and perhaps even randomly connect to new peers until it finds the block.

    Usage:

    0bitcoin-cli getblockfrompeer HASH peer_n
    
  2. Sjors added the label Feature on Oct 15, 2020
  3. MarcoFalke referenced this in commit f6013265b7 on Dec 8, 2021
  4. MarcoFalke closed this on Dec 8, 2021

  5. DrahtBot locked this on Dec 8, 2022


Sjors

Labels
Feature


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-09-29 01:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me