Skip to content

Commit 3adbb4e

Browse files
committed
fix: redundant account destruction after state modification
1 parent 4198b9c commit 3adbb4e

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
@@ -946,14 +946,11 @@ def process_transaction(
946946
coinbase_balance_after_mining_fee = get_account(
947947
block_env.state, block_env.coinbase
948948
).balance + U256(transaction_fee)
949-
if coinbase_balance_after_mining_fee != 0:
950-
set_account_balance(
951-
block_env.state,
952-
block_env.coinbase,
953-
coinbase_balance_after_mining_fee,
954-
)
955-
elif account_exists_and_is_empty(block_env.state, block_env.coinbase):
956-
destroy_account(block_env.state, block_env.coinbase)
949+
set_account_balance(
950+
block_env.state,
951+
block_env.coinbase,
952+
coinbase_balance_after_mining_fee,
953+
)
957954

958955
for address in tx_output.accounts_to_delete:
959956
destroy_account(block_env.state, address)
@@ -998,9 +995,6 @@ def increase_recipient_balance(recipient: Account) -> None:
998995

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

1001-
if account_exists_and_is_empty(block_env.state, wd.address):
1002-
destroy_account(block_env.state, wd.address)
1003-
1004998

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

0 commit comments

Comments
 (0)