diff options
author | obscuren <geffobscura@gmail.com> | 2015-06-17 16:20:33 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-06-17 16:20:33 +0800 |
commit | 5721fcf668f8ab798b6602dc6ff88726bf0c8f86 (patch) | |
tree | 5ba543be4de8caca8950ae09f4fb28c1eb45be91 /core/state_transition.go | |
parent | dfd18d245af37344f8e6fadca55f22a639d7f1ba (diff) | |
download | dexon-5721fcf668f8ab798b6602dc6ff88726bf0c8f86.tar.gz dexon-5721fcf668f8ab798b6602dc6ff88726bf0c8f86.tar.zst dexon-5721fcf668f8ab798b6602dc6ff88726bf0c8f86.zip |
core/state, core/vm: cleanup refunds
Diffstat (limited to 'core/state_transition.go')
-rw-r--r-- | core/state_transition.go | 8 |
1 files changed, 3 insertions, 5 deletions
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()) } |