diff options
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/api/debug.go | 8 | ||||
-rw-r--r-- | rpc/api/eth.go | 4 | ||||
-rw-r--r-- | rpc/api/eth_args.go | 2 | ||||
-rw-r--r-- | rpc/api/parsing.go | 4 |
4 files changed, 5 insertions, 13 deletions
diff --git a/rpc/api/debug.go b/rpc/api/debug.go index 003b4d994..d2cbc7f19 100644 --- a/rpc/api/debug.go +++ b/rpc/api/debug.go @@ -146,13 +146,7 @@ func (self *debugApi) SetHead(req *shared.Request) (interface{}, error) { if err := self.codec.Decode(req.Params, &args); err != nil { return nil, shared.NewDecodeParamError(err.Error()) } - - block := self.xeth.EthBlockByNumber(args.BlockNumber) - if block == nil { - return nil, fmt.Errorf("block #%d not found", args.BlockNumber) - } - - self.ethereum.BlockChain().SetHead(block) + self.ethereum.BlockChain().SetHead(uint64(args.BlockNumber)) return nil, nil } diff --git a/rpc/api/eth.go b/rpc/api/eth.go index 6db006a46..4722682ff 100644 --- a/rpc/api/eth.go +++ b/rpc/api/eth.go @@ -168,9 +168,7 @@ func (self *ethApi) IsMining(req *shared.Request) (interface{}, error) { } func (self *ethApi) IsSyncing(req *shared.Request) (interface{}, error) { - current := self.ethereum.BlockChain().CurrentBlock().NumberU64() - origin, height := self.ethereum.Downloader().Boundaries() - + origin, current, height := self.ethereum.Downloader().Progress() if current < height { return map[string]interface{}{ "startingBlock": newHexNum(big.NewInt(int64(origin)).Bytes()), diff --git a/rpc/api/eth_args.go b/rpc/api/eth_args.go index 66c190a51..6aca6a663 100644 --- a/rpc/api/eth_args.go +++ b/rpc/api/eth_args.go @@ -838,7 +838,7 @@ func NewLogRes(log *vm.Log) LogRes { } l.Address = newHexData(log.Address) l.Data = newHexData(log.Data) - l.BlockNumber = newHexNum(log.Number) + l.BlockNumber = newHexNum(log.BlockNumber) l.LogIndex = newHexNum(log.Index) l.TransactionHash = newHexData(log.TxHash) l.TransactionIndex = newHexNum(log.TxIndex) diff --git a/rpc/api/parsing.go b/rpc/api/parsing.go index cdfaa0ed1..7667616ff 100644 --- a/rpc/api/parsing.go +++ b/rpc/api/parsing.go @@ -453,8 +453,8 @@ func NewReceiptRes(rec *types.Receipt) *ReceiptRes { v.ContractAddress = newHexData(rec.ContractAddress) } - logs := make([]interface{}, len(rec.Logs())) - for i, log := range rec.Logs() { + logs := make([]interface{}, len(rec.Logs)) + for i, log := range rec.Logs { logs[i] = NewLogRes(log) } v.Logs = &logs |