diff options
author | obscuren <geffobscura@gmail.com> | 2014-05-06 23:43:34 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-05-06 23:43:34 +0800 |
commit | 76d7bad722dd4e5a94a3665ad94af65e2f421a8b (patch) | |
tree | 780b8a515799641420d4de0159f76b0c09fe0b2d | |
parent | a0af7de58eeba598c8e967ae9deefb4ee287a1df (diff) | |
parent | 050684450befaac8972120688b69825e8f0acbca (diff) | |
download | go-tangerine-76d7bad722dd4e5a94a3665ad94af65e2f421a8b.tar go-tangerine-76d7bad722dd4e5a94a3665ad94af65e2f421a8b.tar.gz go-tangerine-76d7bad722dd4e5a94a3665ad94af65e2f421a8b.tar.bz2 go-tangerine-76d7bad722dd4e5a94a3665ad94af65e2f421a8b.tar.lz go-tangerine-76d7bad722dd4e5a94a3665ad94af65e2f421a8b.tar.xz go-tangerine-76d7bad722dd4e5a94a3665ad94af65e2f421a8b.tar.zst go-tangerine-76d7bad722dd4e5a94a3665ad94af65e2f421a8b.zip |
Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop
-rw-r--r-- | ethereum.go | 4 | ||||
-rw-r--r-- | ethrpc/packages.go | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/ethereum.go b/ethereum.go index 707938639..2f4db7336 100644 --- a/ethereum.go +++ b/ethereum.go @@ -339,7 +339,9 @@ func (s *Ethereum) Stop() { close(s.quit) - s.RpcServer.Stop() + if s.RpcServer != nil { + s.RpcServer.Stop() + } s.txPool.Stop() s.stateManager.Stop() diff --git a/ethrpc/packages.go b/ethrpc/packages.go index b989a65cb..4ec2b4602 100644 --- a/ethrpc/packages.go +++ b/ethrpc/packages.go @@ -4,7 +4,8 @@ import ( "encoding/json" "errors" "github.com/ethereum/eth-go/ethpub" - _ "log" + "github.com/ethereum/eth-go/ethutil" + "math/big" ) type EthereumApi struct { @@ -173,7 +174,10 @@ func (p *EthereumApi) GetStorageAt(args *GetStorageArgs, reply *string) error { return err } state := p.ethp.GetStateObject(args.Address) - value := state.GetStorage(args.Key) + // Convert the incoming string (which is a bigint) into hex + i, _ := new(big.Int).SetString(args.Key, 10) + hx := ethutil.Hex(i.Bytes()) + value := state.GetStorage(hx) *reply = NewSuccessRes(GetStorageAtRes{Address: args.Address, Key: args.Key, Value: value}) return nil } |