aboutsummaryrefslogtreecommitdiffstats
path: root/vm
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-02-27 01:39:05 +0800
committerobscuren <geffobscura@gmail.com>2015-02-27 03:08:35 +0800
commite235b57234a68a8a39cfe7691a1825d8c6bb3443 (patch)
treea9531d9e14c15abd72625a98a21a9b988dc32319 /vm
parenta1c830cd3c53bce7748d97e3f99fe6a90d526adb (diff)
downloadgo-tangerine-e235b57234a68a8a39cfe7691a1825d8c6bb3443.tar
go-tangerine-e235b57234a68a8a39cfe7691a1825d8c6bb3443.tar.gz
go-tangerine-e235b57234a68a8a39cfe7691a1825d8c6bb3443.tar.bz2
go-tangerine-e235b57234a68a8a39cfe7691a1825d8c6bb3443.tar.lz
go-tangerine-e235b57234a68a8a39cfe7691a1825d8c6bb3443.tar.xz
go-tangerine-e235b57234a68a8a39cfe7691a1825d8c6bb3443.tar.zst
go-tangerine-e235b57234a68a8a39cfe7691a1825d8c6bb3443.zip
Fixed consensus issue for refunding
* Refund should _always_ go to the origin
Diffstat (limited to 'vm')
-rw-r--r--vm/vm.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/vm/vm.go b/vm/vm.go
index f9efeed96..7aeeea661 100644
--- a/vm/vm.go
+++ b/vm/vm.go
@@ -664,6 +664,7 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I
}
addr = ref.Address()
+ fmt.Printf("CREATE %X\n", addr)
stack.Push(ethutil.BigD(addr))
}
@@ -727,7 +728,7 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I
self.Printf(" => (%x) %v", receiver.Address()[:4], balance)
- receiver.AddAmount(balance)
+ receiver.AddBalance(balance)
statedb.Delete(context.Address())
fallthrough
@@ -828,7 +829,7 @@ func (self *Vm) calculateGasAndSize(context *Context, caller ContextRef, op OpCo
// 0 => non 0
mult = ethutil.Big3
} else if len(val) > 0 && len(y.Bytes()) == 0 {
- statedb.Refund(caller.Address(), GasSStoreRefund)
+ statedb.Refund(self.env.Origin(), GasSStoreRefund)
mult = ethutil.Big0
} else {