aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-10-27 18:44:40 +0800
committerobscuren <geffobscura@gmail.com>2014-10-27 18:44:40 +0800
commit1d3f43f060e9ebb312fc3b17fc0fe43c8f95cd82 (patch)
tree5deb4a4de6d565eac8afa3ddc8cbf5b99bdd3223
parentd586dd902d1d850cb133583e8f6599e2a2973107 (diff)
downloadgo-tangerine-1d3f43f060e9ebb312fc3b17fc0fe43c8f95cd82.tar.gz
go-tangerine-1d3f43f060e9ebb312fc3b17fc0fe43c8f95cd82.tar.zst
go-tangerine-1d3f43f060e9ebb312fc3b17fc0fe43c8f95cd82.zip
Added generic add balance method
-rw-r--r--ethstate/state.go7
1 files changed, 7 insertions, 0 deletions
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 {