aboutsummaryrefslogtreecommitdiffstats
path: root/vm
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-11-14 01:12:12 +0800
committerobscuren <geffobscura@gmail.com>2014-11-14 01:12:12 +0800
commit20d518ee959f1621a5accf1f3432282a6c0d6c3c (patch)
treec1c9dcd1e2ced349d11edeca7d2ef179b092fc9b /vm
parent60cdb1148c404218846fd39331690658168f4e04 (diff)
downloadgo-tangerine-20d518ee959f1621a5accf1f3432282a6c0d6c3c.tar
go-tangerine-20d518ee959f1621a5accf1f3432282a6c0d6c3c.tar.gz
go-tangerine-20d518ee959f1621a5accf1f3432282a6c0d6c3c.tar.bz2
go-tangerine-20d518ee959f1621a5accf1f3432282a6c0d6c3c.tar.lz
go-tangerine-20d518ee959f1621a5accf1f3432282a6c0d6c3c.tar.xz
go-tangerine-20d518ee959f1621a5accf1f3432282a6c0d6c3c.tar.zst
go-tangerine-20d518ee959f1621a5accf1f3432282a6c0d6c3c.zip
Numerous fixes for consensus.
* Removed (buged) C++ specific gas specification for LOG* * Fixed LOG* where mstart went after msize *
Diffstat (limited to 'vm')
-rw-r--r--vm/vm_debug.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/vm/vm_debug.go b/vm/vm_debug.go
index 290eddda4..37ad7620e 100644
--- a/vm/vm_debug.go
+++ b/vm/vm_debug.go
@@ -169,6 +169,8 @@ func (self *DebugVm) RunClosure(closure *Closure) (ret []byte, err error) {
gas.Set(GasLog)
addStepGasUsage(new(big.Int).Mul(big.NewInt(int64(n)), GasLog))
addStepGasUsage(new(big.Int).Add(mSize, mStart))
+ // BUG in C++
+ //gas.Set(ethutil.Big1)
// Gas only
case STOP:
gas.Set(ethutil.Big0)
@@ -732,12 +734,16 @@ func (self *DebugVm) RunClosure(closure *Closure) (ret []byte, err error) {
case LOG0, LOG1, LOG2, LOG3, LOG4:
n := int(op - LOG0)
topics := make([][]byte, n)
- mSize, mStart := stack.Pop().Int64(), stack.Pop().Int64()
+ mStart, mSize := stack.Pop().Int64(), stack.Pop().Int64()
data := mem.Geti(mStart, mSize)
for i := 0; i < n; i++ {
topics[i] = stack.Pop().Bytes()
}
- self.env.AddLog(&state.Log{closure.Address(), topics, data})
+
+ log := &state.Log{closure.Address(), topics, data}
+ self.env.AddLog(log)
+
+ self.Printf(" => %v", log)
case MLOAD:
offset := stack.Pop()
val := ethutil.BigD(mem.Get(offset.Int64(), 32))