|
|
@ -253,13 +253,13 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if args.Index >= int64(len(br.Uncles)) || args.Index < 0 { |
|
|
|
if args.Index >= int64(len(br.Uncles)) || args.Index < 0 { |
|
|
|
return NewValidationError("Index", "does not exist") |
|
|
|
// return NewValidationError("Index", "does not exist")
|
|
|
|
} |
|
|
|
*reply = nil |
|
|
|
|
|
|
|
} else { |
|
|
|
uhash := br.Uncles[args.Index] |
|
|
|
uhash := br.Uncles[args.Index] |
|
|
|
uncle := NewBlockRes(api.xeth().EthBlockByHash(uhash.String()), false) |
|
|
|
uncle := NewBlockRes(api.xeth().EthBlockByHash(uhash.String()), true) |
|
|
|
|
|
|
|
|
|
|
|
*reply = uncle |
|
|
|
*reply = uncle |
|
|
|
|
|
|
|
} |
|
|
|
case "eth_getUncleByBlockNumberAndIndex": |
|
|
|
case "eth_getUncleByBlockNumberAndIndex": |
|
|
|
args := new(BlockNumIndexArgs) |
|
|
|
args := new(BlockNumIndexArgs) |
|
|
|
if err := json.Unmarshal(req.Params, &args); err != nil { |
|
|
|
if err := json.Unmarshal(req.Params, &args); err != nil { |
|
|
@ -275,13 +275,13 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if args.Index >= int64(len(v.Uncles)) || args.Index < 0 { |
|
|
|
if args.Index >= int64(len(v.Uncles)) || args.Index < 0 { |
|
|
|
return NewValidationError("Index", "does not exist") |
|
|
|
// return NewValidationError("Index", "does not exist")
|
|
|
|
} |
|
|
|
*reply = nil |
|
|
|
|
|
|
|
} else { |
|
|
|
uhash := v.Uncles[args.Index] |
|
|
|
uhash := v.Uncles[args.Index] |
|
|
|
uncle := NewBlockRes(api.xeth().EthBlockByHash(uhash.String()), false) |
|
|
|
uncle := NewBlockRes(api.xeth().EthBlockByHash(uhash.String()), false) |
|
|
|
|
|
|
|
|
|
|
|
*reply = uncle |
|
|
|
*reply = uncle |
|
|
|
|
|
|
|
} |
|
|
|
case "eth_getCompilers": |
|
|
|
case "eth_getCompilers": |
|
|
|
c := []string{""} |
|
|
|
c := []string{""} |
|
|
|
*reply = c |
|
|
|
*reply = c |
|
|
|