Dear All,
I use the python-bitcoinlib getblock function
r = self._call('getblock', block_hash, False)But i get the hex string format
020000003a42e1a730bd55a38c56d2f07a7094bb8d0e689............
how to decode the hex string to human readable for human readable format?
Thanks
def getblock(self, block_hash):
"""Get block <block_hash>
Raises IndexError if block_hash is not valid.
"""
try:
block_hash = b2lx(block_hash)
except TypeError:
raise TypeError('%s.getblock(): block_hash must be bytes; got %r instance' %
(self.__class__.__name__, block_hash.__class__))
try:
r = self._call('getblock', block_hash, False)
except JSONRPCException as ex:
raise IndexError('%s.getblock(): %s (%d)' %
(self.__class__.__name__, ex.error['message'], ex.error['code']))
return CBlock.deserialize(unhexlify(r))