Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"error_code": block_number,
"error_message": data[4:-1].decode("ascii", "ignore"),
}
# An error was reported by the client which terminates the exchange
logging.error(
"Error reported from client: %s" % self._stats.error["error_message"]
)
self._transmit_error()
self._should_stop = True
return
if code != constants.OPCODE_ACK:
logging.error(
"Expected an ACK opcode from %s, got: %d" % (self._peer, code)
)
self._stats.error = {
"error_code": constants.ERR_ILLEGAL_OPERATION,
"error_message": "I only do reads, really",
}
self._transmit_error()
self._should_stop = True
return
self._handle_ack(block_number)