RPC: add getbestblockhash, to return tip of best chain #2812

pull jgarzik wants to merge 1 commits into bitcoin:master from jgarzik:rpcbestblock changing 3 files +11 −0
  1. jgarzik commented at 3:05 PM on July 3, 2013: contributor

    This information is available via roundabout methods*, but not directly.

    • gettxoutsetinfo or getblockcount->getblockhash
  2. RPC: add getbestblockhash, to return tip of best chain 091aa8dae9
  3. luke-jr commented at 4:39 PM on July 3, 2013: member

    If roundabout methods are good enough for getting the full data for a block (all the transactions), why not this too?

    At the very least, it would seem to me to make better sense as an interface, to use getblockhash with negative indexes (eg, -1 = last block).

  4. jgarzik commented at 4:41 PM on July 3, 2013: contributor

    @luke-jr That is actually another todo item. Getting an entire, raw block is difficult, potentially impossible without -txindex. This is frustrating, because the data is certainly available to bitcoind.

    I've been planning a 'getrawblock <hash>' RPC pull request for this reason.

  5. luke-jr commented at 4:59 PM on July 3, 2013: member

    @jgarzik Well, getting the raw data is already possible with getblock. But getting the fully detailed data for all the transactions was removed back after getblock got added...

  6. jgarzik commented at 5:02 PM on July 3, 2013: contributor

    ...due to the txindex issue previously mentioned. But it need not be that way.

  7. BitcoinPullTester commented at 3:17 PM on July 8, 2013: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/091aa8dae9b7345a1cd81e2733766463dfbf4b82 for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  8. gavinandresen commented at 1:57 AM on July 10, 2013: contributor

    ACK. Compiled and run on the Mac, tested with half-downloaded testnet chain and with a new, zero-connections, zero-blocks bitcoind.

  9. jgarzik referenced this in commit 3b837d5679 on Jul 10, 2013
  10. jgarzik merged this on Jul 10, 2013
  11. jgarzik closed this on Jul 10, 2013

  12. jgarzik deleted the branch on Aug 24, 2014
  13. Bushstar referenced this in commit ad7defba92 on Apr 5, 2019
  14. DrahtBot locked this on Sep 8, 2021

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: 2026-04-20 00:15 UTC

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