|
10 | 10 | from ethereum.exceptions import InvalidNonce, InsufficientStartGas, UnsignedTransaction, \
|
11 | 11 | BlockGasLimitReached, InsufficientBalance, VerificationFailed
|
12 | 12 | from ethereum.utils import safe_ord, normalize_address, mk_contract_address, \
|
13 |
| - mk_metropolis_contract_address, int_to_addr, big_endian_to_int |
| 13 | + mk_metropolis_contract_address, big_endian_to_int |
14 | 14 | from ethereum import transactions
|
15 | 15 | import ethereum.config as config
|
16 | 16 |
|
@@ -309,12 +309,12 @@ def create_contract(ext, msg):
|
309 | 309 | if ext._block.number >= ext._block.METROPOLIS_FORK_BLKNUM:
|
310 | 310 | msg.to = mk_metropolis_contract_address(msg.sender, code)
|
311 | 311 | if ext.get_code(msg.to):
|
312 |
| - if ext.get_nonce(msg.to) >= 2**40: |
313 |
| - ext.set_nonce(msg.to, (ext.get_nonce(msg.to) + 1) % 2**160) |
314 |
| - msg.to = normalize_address((ext.get_nonce(msg.to) - 1) % 2**160) |
| 312 | + if ext.get_nonce(msg.to) >= 2 ** 40: |
| 313 | + ext.set_nonce(msg.to, (ext.get_nonce(msg.to) + 1) % 2 ** 160) |
| 314 | + msg.to = normalize_address((ext.get_nonce(msg.to) - 1) % 2 ** 160) |
315 | 315 | else:
|
316 |
| - ext.set_nonce(msg.to, (big_endian_to_int(msg.to) + 2) % 2**160) |
317 |
| - msg.to = normalize_address((ext.get_nonce(msg.to) - 1) % 2**160) |
| 316 | + ext.set_nonce(msg.to, (big_endian_to_int(msg.to) + 2) % 2 ** 160) |
| 317 | + msg.to = normalize_address((ext.get_nonce(msg.to) - 1) % 2 ** 160) |
318 | 318 | else:
|
319 | 319 | if ext.tx_origin != msg.sender:
|
320 | 320 | ext._block.increment_nonce(msg.sender)
|
|
0 commit comments