Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop

This commit is contained in:
obscuren 2014-05-06 17:43:34 +02:00
commit 76d7bad722
2 changed files with 9 additions and 3 deletions

View File

@ -339,7 +339,9 @@ func (s *Ethereum) Stop() {
close(s.quit) close(s.quit)
if s.RpcServer != nil {
s.RpcServer.Stop() s.RpcServer.Stop()
}
s.txPool.Stop() s.txPool.Stop()
s.stateManager.Stop() s.stateManager.Stop()

View File

@ -4,7 +4,8 @@ import (
"encoding/json" "encoding/json"
"errors" "errors"
"github.com/ethereum/eth-go/ethpub" "github.com/ethereum/eth-go/ethpub"
_ "log" "github.com/ethereum/eth-go/ethutil"
"math/big"
) )
type EthereumApi struct { type EthereumApi struct {
@ -173,7 +174,10 @@ func (p *EthereumApi) GetStorageAt(args *GetStorageArgs, reply *string) error {
return err return err
} }
state := p.ethp.GetStateObject(args.Address) 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}) *reply = NewSuccessRes(GetStorageAtRes{Address: args.Address, Key: args.Key, Value: value})
return nil return nil
} }