diff options
author | obscuren <geffobscura@gmail.com> | 2015-03-17 18:19:23 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-03-17 18:19:23 +0800 |
commit | 515d9432fcef8c574627049d437d6898b56c2829 (patch) | |
tree | 40322c532a38b8f563d452bd75dab69729e55d92 /vm/vm.go | |
parent | 8ce6a3647821706cf5e9bb1a9dc13f23c84f6585 (diff) | |
download | dexon-515d9432fcef8c574627049d437d6898b56c2829.tar dexon-515d9432fcef8c574627049d437d6898b56c2829.tar.gz dexon-515d9432fcef8c574627049d437d6898b56c2829.tar.bz2 dexon-515d9432fcef8c574627049d437d6898b56c2829.tar.lz dexon-515d9432fcef8c574627049d437d6898b56c2829.tar.xz dexon-515d9432fcef8c574627049d437d6898b56c2829.tar.zst dexon-515d9432fcef8c574627049d437d6898b56c2829.zip |
converted vm
Diffstat (limited to 'vm/vm.go')
-rw-r--r-- | vm/vm.go | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -58,8 +58,10 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) { }() } - if p := Precompiled[context.CodeAddr.Str()]; p != nil { - return self.RunPrecompiled(p, callData, context) + if context.CodeAddr != nil { + if p := Precompiled[context.CodeAddr.Str()]; p != nil { + return self.RunPrecompiled(p, callData, context) + } } var ( @@ -500,7 +502,7 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) { n := new(big.Int).Sub(self.env.BlockNumber(), common.Big257) if num.Cmp(n) > 0 && num.Cmp(self.env.BlockNumber()) < 0 { - stack.push(common.BigD(self.env.GetHash(num.Uint64()))) + stack.push(self.env.GetHash(num.Uint64()).Big()) } else { stack.push(common.Big0) } @@ -509,7 +511,7 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) { case COINBASE: coinbase := self.env.Coinbase() - stack.push(common.BigD(coinbase)) + stack.push(coinbase.Big()) self.Printf(" => 0x%x", coinbase) case TIMESTAMP: |