diff options
Diffstat (limited to 'rpc/api/eth.go')
-rw-r--r-- | rpc/api/eth.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/rpc/api/eth.go b/rpc/api/eth.go index e1e7381f5..cb678922b 100644 --- a/rpc/api/eth.go +++ b/rpc/api/eth.go @@ -140,7 +140,7 @@ func (self *ethApi) IsMining(req *shared.Request) (interface{}, error) { } func (self *ethApi) GasPrice(req *shared.Request) (interface{}, error) { - return newHexNum(xeth.DefaultGasPrice().Bytes()), nil + return newHexNum(self.xeth.DefaultGasPrice().Bytes()), nil } func (self *ethApi) GetStorage(req *shared.Request) (interface{}, error) { @@ -274,7 +274,14 @@ func (self *ethApi) SendTransaction(req *shared.Request) (interface{}, error) { nonce = args.Nonce.String() } - v, err := self.xeth.Transact(args.From, args.To, nonce, args.Value.String(), args.Gas.String(), args.GasPrice.String(), args.Data) + var gas, price string + if args.Gas != nil { + gas = args.Gas.String() + } + if args.GasPrice != nil { + price = args.GasPrice.String() + } + v, err := self.xeth.Transact(args.From, args.To, nonce, args.Value.String(), gas, price, args.Data) if err != nil { return nil, err } |