Skip to content
This repository was archived by the owner on Oct 28, 2021. It is now read-only.

Commit 29ed24e

Browse files
committed
Check balance in SELFDESTRUCT only when really necessary
1 parent fcb1f3d commit 29ed24e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

libaleth-interpreter/VM.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,8 @@ void VM::interpretCases()
384384
if (m_rev >= EVMC_TANGERINE_WHISTLE)
385385
{
386386
// After EIP158 zero-value suicides do not have to pay account creation gas.
387-
u256 const balance =
388-
fromEvmC(m_context->host->get_balance(m_context, &m_message->destination));
389-
if (balance > 0 || m_rev == EVMC_TANGERINE_WHISTLE)
387+
if (m_rev == EVMC_TANGERINE_WHISTLE ||
388+
fromEvmC(m_context->host->get_balance(m_context, &m_message->destination)) > 0)
390389
{
391390
// After EIP150 hard fork charge additional cost of sending
392391
// ethers to non-existing account.

0 commit comments

Comments
 (0)