Skip to content

Commit

Permalink
Additional cost of SELFDESTRUCT sending to non-existing account
Browse files Browse the repository at this point in the history
This implements version 1c of EIP150 ethereum/EIPs#150.
  • Loading branch information
chfast authored and marcusrbrown committed Oct 17, 2016
1 parent 30a7f20 commit 30a38c4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions libevm/VM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,15 @@ void VM::interpretCases()
CASE_BEGIN(SUICIDE)
{
m_runGas = toUint64(m_schedule->suicideGas);
Address dest = asAddress(*m_sp);

// After EIP150 hard fork charge additional cost of sending
// ethers to non-existing account.
if (!m_schedule->staticCallDepthLimit && !m_ext->exists(dest))
m_runGas += m_schedule->callNewAccountGas;

onOperation();
updateIOGas();

Address dest = asAddress(*m_sp);
m_ext->suicide(dest);
m_bounce = 0;
}
Expand Down

0 comments on commit 30a38c4

Please sign in to comment.