Skip to content

Commit a9ce06c

Browse files
EperezOkSamWilsn
authored andcommitted
fix: redundant account destruction after state modification
1 parent c612d3d commit a9ce06c

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

src/ethereum/prague/fork.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -945,14 +945,11 @@ def process_transaction(
945945
coinbase_balance_after_mining_fee = get_account(
946946
block_env.state, block_env.coinbase
947947
).balance + U256(transaction_fee)
948-
if coinbase_balance_after_mining_fee != 0:
949-
set_account_balance(
950-
block_env.state,
951-
block_env.coinbase,
952-
coinbase_balance_after_mining_fee,
953-
)
954-
elif account_exists_and_is_empty(block_env.state, block_env.coinbase):
955-
destroy_account(block_env.state, block_env.coinbase)
948+
set_account_balance(
949+
block_env.state,
950+
block_env.coinbase,
951+
coinbase_balance_after_mining_fee,
952+
)
956953

957954
for address in tx_output.accounts_to_delete:
958955
destroy_account(block_env.state, address)
@@ -997,9 +994,6 @@ def increase_recipient_balance(recipient: Account) -> None:
997994

998995
modify_state(block_env.state, wd.address, increase_recipient_balance)
999996

1000-
if account_exists_and_is_empty(block_env.state, wd.address):
1001-
destroy_account(block_env.state, wd.address)
1002-
1003997

1004998
def check_gas_limit(gas_limit: Uint, parent_gas_limit: Uint) -> bool:
1005999
"""

0 commit comments

Comments
 (0)