From a3ee8a4622e018109ff607db13b7deab0d573374 Mon Sep 17 00:00:00 2001 From: yihuang Date: Mon, 21 Jun 2021 16:02:05 +0800 Subject: [PATCH] rpc: fix default nonce (#152) fixes #151 --- ethereum/rpc/eth_api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethereum/rpc/eth_api.go b/ethereum/rpc/eth_api.go index cda1ba4a..5d707286 100644 --- a/ethereum/rpc/eth_api.go +++ b/ethereum/rpc/eth_api.go @@ -972,7 +972,7 @@ func (e *PublicEthAPI) setTxDefaults(args rpctypes.SendTxArgs) (rpctypes.SendTxA args.GasPrice = (*hexutil.Big)(big.NewInt(ethermint.DefaultGasPrice)) } - if args.Nonce != nil { + if args.Nonce == nil { // get the nonce from the account retriever // ignore error in case tge account doesn't exist yet _, nonce, _ := e.clientCtx.AccountRetriever.GetAccountNumberSequence(e.clientCtx, from)