Alternative to getblock that works even when the block itself has been pruned, returning all available information. Right now the fact that you can't get this information in pruned mode makes pruned nodes quite a bit less useful for some applications.
Add getblockheader RPC call #6247
pull petertodd wants to merge 1 commits into bitcoin:master from petertodd:getblockheader-rpc-call changing 4 files +85 −0-
petertodd commented at 4:58 AM on June 7, 2015: contributor
-
076badb60f
Add getblockheader RPC call
Alternative to getblock that works even when the block itself has been pruned, returning all available information.
-
laanwj commented at 6:58 AM on June 7, 2015: member
Not against this, but you can get already get block headers using REST
/rest/headers/<count>/<hash>.<ext>. -
jonasschnelli commented at 7:08 AM on June 7, 2015: contributor
Also not against this, but i think public blockchain data like blocks (headers), transactions or UTXO queries should go over REST instead over an authenticated RPC call. This would follow a more logical design.
Nevertheless, this can be useful because we never merge JSON support for REST Headers (https://github.com/bitcoin/bitcoin/pull/5486/files).
What about getting more in line with REST and also support requesting more than one header
(/rest/headers/***<count>***/<hash>.<ext>.)? -
jgarzik commented at 7:16 AM on June 7, 2015: contributor
That's the general goal of REST - querying public, unauthenticated blockchain data from the blockchain engine. Seems better placed there, than RPC.
-
paveljanik commented at 5:57 AM on June 8, 2015: contributor
This allows you to get the needed information directly from the Debug window/Console without the needed hackery around the
-restcmdline etc. Very useful! Thanks Peter.utACK
- laanwj added the label RPC on Jun 9, 2015
-
in src/rpcblockchain.cpp:None in 076badb60f
50 | @@ -51,6 +51,32 @@ double GetDifficulty(const CBlockIndex* blockindex) 51 | return dDiff; 52 | } 53 | 54 | +UniValue blockheaderToJSON(const CBlockIndex* blockindex)
laanwj commented at 5:00 AM on June 30, 2015: memberTested ACK
petertodd commented at 5:16 AM on June 30, 2015: contributor@jgarzik Re: "unauthenticated" data, remember that this is trusted data in the sense that the client would be trusting the full node's opinion on what the valid chain is; I'm not sure I'd use the term "unauthenticated" in describing that, rather, public and trusted.
laanwj merged this on Jul 2, 2015laanwj closed this on Jul 2, 2015laanwj referenced this in commit 726e28643c on Jul 2, 2015dcousens commented at 5:53 AM on December 4, 2015: contributorNeeds to be updated in the docs?
zkbot referenced this in commit 9af55822fb on Feb 15, 2017zkbot referenced this in commit a7cf698873 on Mar 4, 2017DrahtBot locked this on Sep 8, 2021Labels
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: 2026-04-13 15:15 UTC
More mirrored repositories can be found on mirror.b10c.me