提交 2628103f 编写于 作者: O obscuren

rpc/api: fixed default gas-(price) issue.

上级 e79cc42d
......@@ -259,7 +259,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
}
......
......@@ -333,9 +333,7 @@ func (args *NewTxArgs) UnmarshalJSON(b []byte) (err error) {
args.Value = num
num = nil
if ext.Gas == nil {
num = big.NewInt(0)
} else {
if ext.Gas != nil {
if num, err = numString(ext.Gas); err != nil {
return err
}
......@@ -343,9 +341,7 @@ func (args *NewTxArgs) UnmarshalJSON(b []byte) (err error) {
args.Gas = num
num = nil
if ext.GasPrice == nil {
num = big.NewInt(0)
} else {
if ext.GasPrice != nil {
if num, err = numString(ext.GasPrice); err != nil {
return err
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册