diff --git a/VERSION b/VERSION index d8fc04893..9fdb7c8c6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.63.11 +0.63.12 diff --git a/transactions/transactor.go b/transactions/transactor.go index 7a15d0987..ee690f041 100644 --- a/transactions/transactor.go +++ b/transactions/transactor.go @@ -240,7 +240,7 @@ func (t *Transactor) validateAndPropagate(selectedAccount *account.SelectedExtKe defer func() { // nonce should be incremented only if tx completed without error // if upstream node returned nonce higher than ours we will stick to it - if err == nil { + if err == nil && args.Nonce == nil { t.localNonce.Store(args.From, nonce+1) } t.addrLock.UnlockAddr(args.From) @@ -248,14 +248,20 @@ func (t *Transactor) validateAndPropagate(selectedAccount *account.SelectedExtKe }() ctx, cancel := context.WithTimeout(context.Background(), t.rpcCallTimeout) defer cancel() - nonce, err = t.pendingNonceProvider.PendingNonceAt(ctx, common.Address(args.From)) - if err != nil { - return hash, err - } - // if upstream node returned nonce higher than ours we will use it, as it probably means - // that another client was used for sending transactions - if localNonce > nonce { - nonce = localNonce + + if args.Nonce == nil { + + nonce, err = t.pendingNonceProvider.PendingNonceAt(ctx, common.Address(args.From)) + if err != nil { + return hash, err + } + // if upstream node returned nonce higher than ours we will use it, as it probably means + // that another client was used for sending transactions + if localNonce > nonce { + nonce = localNonce + } + } else { + nonce = uint64(*args.Nonce) } gasPrice := (*big.Int)(args.GasPrice) if args.GasPrice == nil {