|
9 | 9 | from rlp.utils import encode_hex
|
10 | 10 | from ethereum import blocks
|
11 | 11 | from ethereum import processblock
|
| 12 | +from ethereum.exceptions import VerificationFailed, InvalidTransaction |
12 | 13 | from ethereum.slogging import get_logger
|
13 | 14 | from ethereum.config import Env
|
14 | 15 | import sys
|
@@ -301,7 +302,7 @@ def add_block(self, block, forward_pending_transactions=True):
|
301 | 302 | if block.has_parent():
|
302 | 303 | try:
|
303 | 304 | processblock.verify(block, block.get_parent())
|
304 |
| - except processblock.VerificationFailed as e: |
| 305 | + except VerificationFailed as e: |
305 | 306 | _log.critical('VERIFICATION FAILED', error=e)
|
306 | 307 | f = os.path.join(utils.data_dir, 'badblock.log')
|
307 | 308 | open(f, 'w').write(to_string(block.hex_serialize()))
|
@@ -351,7 +352,7 @@ def add_transaction(self, transaction):
|
351 | 352 | head_candidate.state_root = self.pre_finalize_state_root
|
352 | 353 | try:
|
353 | 354 | success, output = processblock.apply_transaction(head_candidate, transaction)
|
354 |
| - except processblock.InvalidTransaction as e: |
| 355 | + except InvalidTransaction as e: |
355 | 356 | # if unsuccessful the prerequisites were not fullfilled
|
356 | 357 | # and the tx is invalid, state must not have changed
|
357 | 358 | log.debug('invalid tx', error=e)
|
|
0 commit comments