MCPcopy
hub / github.com/petertodd/python-bitcoinlib / getblockhash

Method getblockhash

bitcoin/rpc.py:515–524  ·  view source on GitHub ↗

Return hash of block in best-block-chain at height. Raises IndexError if height is not valid.

(self, height)

Source from the content-addressed store, hash-verified

513 return self._call('getblockcount')
514
515 def getblockhash(self, height):
516 """Return hash of block in best-block-chain at height.
517
518 Raises IndexError if height is not valid.
519 """
520 try:
521 return lx(self._call('getblockhash', height))
522 except InvalidParameterError as ex:
523 raise IndexError('%s.getblockhash(): %s (%d)' %
524 (self.__class__.__name__, ex.error['message'], ex.error['code']))
525
526 def getinfo(self):
527 """Return a JSON object containing various state info"""

Callers 1

Calls 2

lxFunction · 0.90
_callMethod · 0.45

Tested by

no test coverage detected