Change the execution timeout based on the tx count

fix/timeout
Nikhil Parasaram 6 years ago
parent 40d02c662a
commit ecd975023d
  1. 2
      mythril/laser/ethereum/svm.py
  2. 4
      mythril/laser/ethereum/time_handler.py

@ -125,7 +125,7 @@ class LaserEVM:
for hook in self._start_sym_exec_hooks: for hook in self._start_sym_exec_hooks:
hook() hook()
time_handler.start_execution(self.execution_timeout) time_handler.start_execution(self.execution_timeout, self.transaction_count)
self.time = datetime.now() self.time = datetime.now()
if main_address: if main_address:

@ -7,9 +7,9 @@ class TimeHandler(object, metaclass=Singleton):
self._start_time = None self._start_time = None
self._execution_time = None self._execution_time = None
def start_execution(self, execution_time): def start_execution(self, execution_time, transaction_count):
self._start_time = int(time.time() * 1000) self._start_time = int(time.time() * 1000)
self._execution_time = execution_time * 1000 self._execution_time = execution_time * 1000 // transaction_count
def time_remaining(self): def time_remaining(self):
return self._execution_time - (int(time.time() * 1000) - self._start_time) return self._execution_time - (int(time.time() * 1000) - self._start_time)

Loading…
Cancel
Save