Skip to content

Commit

Permalink
Fix calculating refund gas. Resolve ethereum#724
Browse files Browse the repository at this point in the history
  • Loading branch information
Nashatyrev committed Feb 5, 2017
1 parent 0fda9a0 commit 5a05507
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ public TransactionExecutionSummary finalization() {
// Accumulate refunds for suicides
result.addFutureRefund(result.getDeleteAccounts().size() * config.getBlockchainConfig().
getConfigForBlock(currentBlock.getNumber()).getGasCost().getSUICIDE_REFUND());
long gasRefund = Math.min(result.getFutureRefund(), result.getGasUsed() / 2);
long gasRefund = Math.min(result.getFutureRefund(), getGasUsed() / 2);
byte[] addr = tx.isContractCreation() ? tx.getContractAddress() : tx.getReceiveAddress();
m_endGas = m_endGas.add(BigInteger.valueOf(gasRefund));

Expand Down

0 comments on commit 5a05507

Please sign in to comment.