diff --git a/src/miner.cpp b/src/miner.cpp index 7c0ab7780c..4ac103197d 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -636,12 +636,12 @@ bool BlockAssembler::EvmTxPreapply(const EvmTxPreApplyContext& ctx) return false; } const auto nonce = evm_unsafe_try_get_next_valid_nonce_in_q(result, evmQueueId, senderInfo.address); - if (!result.ok || nonce > txResult.nonce) { + if (!result.ok || nonce > senderInfo.nonce) { return false; } - if (nonce < txResult.nonce) { + if (nonce < senderInfo.nonce) { if (!failedTxSet.count(txIter)) { - failedNonces.emplace(txResult.nonce, txIter); + failedNonces.emplace(senderInfo.nonce, txIter); } failedTxSet.insert(txIter); return false; diff --git a/src/txmempool.cpp b/src/txmempool.cpp index ba403452a5..330b0ae026 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -1214,7 +1214,7 @@ Res CTxMemPool::rebuildAccountsView(int height, const CCoinsViewCache& coinsCach if (txType == CustomTxType::EvmTx) { const auto obj = std::get(txMessage); txResult = evm_unsafe_try_validate_raw_tx_in_q(result, evmQueueId, HexStr(obj.evmTx)); - if (result.ok) { + if (!result.ok) { AddToStaged(staged, vtx, iter); if (ptx && ptx->GetHash() == tx.GetHash()) { newEntryRes = Res::Err(result.reason.c_str()); @@ -1253,15 +1253,15 @@ Res CTxMemPool::rebuildAccountsView(int height, const CCoinsViewCache& coinsCach } continue; } - if (nonce > txResult.nonce) { + if (nonce > senderInfo.nonce) { AddToStaged(staged, vtx, iter); if (ptx && ptx->GetHash() == tx.GetHash()) { newEntryRes = Res::Err(result.reason.c_str()); } continue; - } else if (nonce < txResult.nonce) { + } else if (nonce < senderInfo.nonce) { if (!failedTxSet.count(iter)) { - failedNonces.emplace(txResult.nonce, iter); + failedNonces.emplace(senderInfo.nonce, iter); } failedTxSet.insert(iter); continue;