From ecd975023decf7c9fc24b2e38f99ce78d73c6f34 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Thu, 14 Mar 2019 22:27:54 +0530 Subject: [PATCH] Change the execution timeout based on the tx count --- mythril/laser/ethereum/svm.py | 2 +- mythril/laser/ethereum/time_handler.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mythril/laser/ethereum/svm.py b/mythril/laser/ethereum/svm.py index 56e4b948..0f73c32b 100644 --- a/mythril/laser/ethereum/svm.py +++ b/mythril/laser/ethereum/svm.py @@ -125,7 +125,7 @@ class LaserEVM: for hook in self._start_sym_exec_hooks: hook() - time_handler.start_execution(self.execution_timeout) + time_handler.start_execution(self.execution_timeout, self.transaction_count) self.time = datetime.now() if main_address: diff --git a/mythril/laser/ethereum/time_handler.py b/mythril/laser/ethereum/time_handler.py index b8e1379b..f9586fba 100644 --- a/mythril/laser/ethereum/time_handler.py +++ b/mythril/laser/ethereum/time_handler.py @@ -7,9 +7,9 @@ class TimeHandler(object, metaclass=Singleton): self._start_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._execution_time = execution_time * 1000 + self._execution_time = execution_time * 1000 // transaction_count def time_remaining(self): return self._execution_time - (int(time.time() * 1000) - self._start_time)