aboutsummaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
Diffstat (limited to 'rpc')
-rw-r--r--rpc/api.go8
-rw-r--r--rpc/args.go10
2 files changed, 17 insertions, 1 deletions
diff --git a/rpc/api.go b/rpc/api.go
index 6d3a20bfa..b79a1306e 100644
--- a/rpc/api.go
+++ b/rpc/api.go
@@ -173,7 +173,13 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
return fmt.Errorf("Transaction not confirmed")
}
- v, err := api.xeth().Transact(args.From, args.To, args.Value.String(), args.Gas.String(), args.GasPrice.String(), args.Data)
+ // nonce may be nil ("guess" mode)
+ var nonce string
+ if args.Nonce != nil {
+ nonce = args.Nonce.String()
+ }
+
+ v, err := api.xeth().Transact(args.From, args.To, nonce, args.Value.String(), args.Gas.String(), args.GasPrice.String(), args.Data)
if err != nil {
return err
}
diff --git a/rpc/args.go b/rpc/args.go
index 4bd48e6d6..e61f28c4f 100644
--- a/rpc/args.go
+++ b/rpc/args.go
@@ -157,6 +157,7 @@ func (args *GetBlockByNumberArgs) UnmarshalJSON(b []byte) (err error) {
type NewTxArgs struct {
From string
To string
+ Nonce *big.Int
Value *big.Int
Gas *big.Int
GasPrice *big.Int
@@ -170,6 +171,7 @@ func (args *NewTxArgs) UnmarshalJSON(b []byte) (err error) {
var ext struct {
From string
To string
+ Nonce interface{}
Value interface{}
Gas interface{}
GasPrice interface{}
@@ -200,6 +202,14 @@ func (args *NewTxArgs) UnmarshalJSON(b []byte) (err error) {
args.Data = ext.Data
var num *big.Int
+ if ext.Nonce != nil {
+ num, err = numString(ext.Nonce)
+ if err != nil {
+ return err
+ }
+ }
+ args.Nonce = num
+
if ext.Value == nil {
num = big.NewInt(0)
} else {