diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-05-30 03:27:15 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-06-09 20:13:25 +0800 |
commit | c8a9a4e76d00483280a51bb6c0f9517d6c531589 (patch) | |
tree | 7b5b8de46655614b157aab9a21fc76d0f51ba0ec /rpc/args.go | |
parent | 0f1cdfa53ad445df7bf3aed281fc36e53ecbbfd4 (diff) | |
download | dexon-c8a9a4e76d00483280a51bb6c0f9517d6c531589.tar dexon-c8a9a4e76d00483280a51bb6c0f9517d6c531589.tar.gz dexon-c8a9a4e76d00483280a51bb6c0f9517d6c531589.tar.bz2 dexon-c8a9a4e76d00483280a51bb6c0f9517d6c531589.tar.lz dexon-c8a9a4e76d00483280a51bb6c0f9517d6c531589.tar.xz dexon-c8a9a4e76d00483280a51bb6c0f9517d6c531589.tar.zst dexon-c8a9a4e76d00483280a51bb6c0f9517d6c531589.zip |
Differentiate between 0 and unspecified gas/gasprice
Diffstat (limited to 'rpc/args.go')
-rw-r--r-- | rpc/args.go | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/rpc/args.go b/rpc/args.go index 686872a59..50b0f5826 100644 --- a/rpc/args.go +++ b/rpc/args.go @@ -261,22 +261,22 @@ 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 } + } else { + num = nil } 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 } + } else { + num = nil } args.GasPrice = num @@ -346,21 +346,21 @@ func (args *CallArgs) UnmarshalJSON(b []byte) (err error) { } args.Value = num - if ext.Gas == nil { - num = big.NewInt(0) - } else { + if ext.Gas != nil { if num, err = numString(ext.Gas); err != nil { return err } + } else { + num = nil } args.Gas = num - if ext.GasPrice == nil { - num = big.NewInt(0) - } else { + if ext.GasPrice != nil { if num, err = numString(ext.GasPrice); err != nil { return err } + } else { + num = nil } args.GasPrice = num |