@lru_cache(maxsize=32)
def check_pow(block_number, header_hash, mixhash, nonce, difficulty):
 log.debug('checking pow', block_number=block_number)
 if ((len(mixhash) != 32) or (len(header_hash) != 32) or (len(nonce) != 8)):
  return False
 cache = get_cache(block_number)
 mining_output = hashimoto_light(block_number, cache, header_hash, nonce)
 if (mining_output['mix digest'] != mixhash):
  return False
 return (utils.big_endian_to_int(mining_output['result']) <= ((2 ** 256) // (difficulty or 1)))

@ lru_cache ( maxsize = 32 ) def check_pow ( block_number , header_hash , mixhash , nonce , difficulty ) : log . debug ( 'checking pow' , block_number = block_number ) if ( ( len ( mixhash ) != 32 ) or ( len ( header_hash ) != 32 ) or ( len ( nonce ) != 8 ) ) : return False cache = get_cache ( block_number ) mining_output = hashimoto_light ( block_number , cache , header_hash , nonce ) if ( mining_output [ 'mix digest' ] != mixhash ) : return False return ( utils . big_endian_to_int ( mining_output [ 'result' ] ) <= ( ( 2 ** 256 ) // ( difficulty or 1 ) ) )
check if the proof-of-work of the block is valid .