From 5721fcf668f8ab798b6602dc6ff88726bf0c8f86 Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 17 Jun 2015 10:20:33 +0200 Subject: core/state, core/vm: cleanup refunds --- core/state_transition.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'core/state_transition.go') diff --git a/core/state_transition.go b/core/state_transition.go index fedea8021..4a8d92375 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -241,11 +241,9 @@ func (self *StateTransition) refundGas() { sender.AddBalance(remaining) uhalf := new(big.Int).Div(self.gasUsed(), common.Big2) - for addr, ref := range self.state.Refunds() { - refund := common.BigMin(uhalf, ref) - self.gas.Add(self.gas, refund) - self.state.AddBalance(common.StringToAddress(addr), refund.Mul(refund, self.msg.GasPrice())) - } + refund := common.BigMin(uhalf, self.state.Refunds()) + self.gas.Add(self.gas, refund) + self.state.AddBalance(sender.Address(), refund.Mul(refund, self.msg.GasPrice())) coinbase.RefundGas(self.gas, self.msg.GasPrice()) } -- cgit