|
|
@ -177,15 +177,11 @@ func (self *EthereumApi) AllLogs(args *FilterOptions, reply *interface{}) error |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (p *EthereumApi) GetBlock(args *GetBlockArgs, reply *interface{}) error { |
|
|
|
func (p *EthereumApi) GetBlock(args *GetBlockArgs, reply *interface{}) error { |
|
|
|
err := args.requirements() |
|
|
|
// This seems a bit precarious Maybe worth splitting to discrete functions
|
|
|
|
if err != nil { |
|
|
|
if len(args.Hash) > 0 { |
|
|
|
return err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if args.BlockNumber > 0 { |
|
|
|
|
|
|
|
*reply = p.xeth.BlockByNumber(args.BlockNumber) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
*reply = p.xeth.BlockByHash(args.Hash) |
|
|
|
*reply = p.xeth.BlockByHash(args.Hash) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
*reply = p.xeth.BlockByNumber(args.BlockNumber) |
|
|
|
} |
|
|
|
} |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
} |
|
|
|
} |
|
|
|