From d8c4705b2fba95b2671cc159c3cab66af7b99655 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Tue, 19 Mar 2019 18:52:39 +0530 Subject: [PATCH] Add reset_start_time() --- mythril/laser/ethereum/svm.py | 1 + mythril/laser/ethereum/time_handler.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/mythril/laser/ethereum/svm.py b/mythril/laser/ethereum/svm.py index 0f73c32b..bafd18a2 100644 --- a/mythril/laser/ethereum/svm.py +++ b/mythril/laser/ethereum/svm.py @@ -181,6 +181,7 @@ class LaserEVM: initial_coverage = self._get_covered_instructions() self.time = datetime.now() + time_handler.reset_start_time() log.info( "Starting message call transaction, iteration: {}, {} initial states".format( i, len(self.open_states) diff --git a/mythril/laser/ethereum/time_handler.py b/mythril/laser/ethereum/time_handler.py index 6ba1587c..12027a48 100644 --- a/mythril/laser/ethereum/time_handler.py +++ b/mythril/laser/ethereum/time_handler.py @@ -7,6 +7,9 @@ class TimeHandler(object, metaclass=Singleton): self._start_time = None self._transaction_execution_timeout = None + def reset_start_time(self): + self._start_time = int(time.time() * 1000) + def start_execution(self, execution_time: int, transaction_count: int): self._start_time = int(time.time() * 1000) self._transaction_execution_timeout = execution_time * 1000 // transaction_count