From faa1a26f67ea6bf59c80b8913f3235cae9178202 Mon Sep 17 00:00:00 2001 From: libangzhu <601276804@qq.com> Date: Tue, 16 May 2023 16:32:35 +0800 Subject: [PATCH] fix fmt --- plugin/dapp/evm/executor/exec_local.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/plugin/dapp/evm/executor/exec_local.go b/plugin/dapp/evm/executor/exec_local.go index ac9a4dbd1..414296911 100644 --- a/plugin/dapp/evm/executor/exec_local.go +++ b/plugin/dapp/evm/executor/exec_local.go @@ -23,18 +23,15 @@ func (evm *EVMExecutor) ExecLocal(tx *types.Transaction, receipt *types.ReceiptD defer func(lSet *types.LocalDBSet) { if types.IsEthSignID(tx.GetSignature().GetTy()) { nonceLocalKey := secp256k1eth.CaculCoinsEvmAccountKey(tx.From()) - nonceV, err := evm.GetLocalDB().Get(nonceLocalKey) var evmNonce types.EvmAccountNonce - if err == nil { + nonceV, nonceErr := evm.GetLocalDB().Get(nonceLocalKey) + if nonceErr == nil { types.Decode(nonceV, &evmNonce) if evmNonce.GetNonce() == tx.GetNonce() { evmNonce.Nonce++ - } else { //nonce 错误 返回异常 - if evm.GetAPI().GetConfig().IsDappFork(evm.GetHeight(), "evm", evmtypes.ForkEvmExecNonce) { - err = errors.New("invalid nonce") - return - } - + } else if evm.GetAPI().GetConfig().IsDappFork(evm.GetHeight(), "evm", evmtypes.ForkEvmExecNonce) { //nonce 错误 返回异常 + err = errors.New("invalid nonce") + return } } else {