From 1d3f43f060e9ebb312fc3b17fc0fe43c8f95cd82 Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 27 Oct 2014 11:44:40 +0100 Subject: [PATCH] Added generic add balance method --- ethstate/state.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ethstate/state.go b/ethstate/state.go index fd6fa65a5..c23dab330 100644 --- a/ethstate/state.go +++ b/ethstate/state.go @@ -39,6 +39,13 @@ func (self *State) GetBalance(addr []byte) *big.Int { return ethutil.Big0 } +func (self *State) AddBalance(addr []byte, amount *big.Int) { + stateObject := self.GetStateObject(addr) + if stateObject != nil { + stateObject.AddBalance(amount) + } +} + func (self *State) GetNonce(addr []byte) uint64 { stateObject := self.GetStateObject(addr) if stateObject != nil {