def block_hash(self, block_number=None, force_recent=True):
if block_number is None:<EOL><INDENT>block_number = self.block_number() - <NUM_LIT:1><EOL><DEDENT>value = sha3.keccak_256((repr(block_number) + '<STR_LIT>').encode()).hexdigest()<EOL>value = int(value, <NUM_LIT:16>)<EOL>if force_recent:<EOL><INDENT>bnmax = Operators.ITEBV(<NUM_LIT>, self.block_number() > <NUM_LIT>, <NUM_LIT>, self.block_number())<EOL>value = Operators.ITEBV(<NUM_LIT>, Operators.OR(block_number >= self.block_number(), block_number < bnmax), <NUM_LIT:0>, value)<EOL><DEDENT>return value<EOL>
Calculates a block's hash
:param block_number: the block number for which to calculate the hash, defaulting to the most recent block
:param force_recent: if True (the default) return zero for any block that is in the future or older than 256 blocks
:return: the block hash