Skip to content

Commit

Permalink
TD check fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jouzo committed Sep 8, 2023
1 parent 3f742f3 commit a4b3caf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions src/txmempool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ Res CTxMemPool::rebuildAccountsView(int height, const CCoinsViewCache& coinsCach
if (txType == CustomTxType::EvmTx) {
const auto obj = std::get<CEvmTxMessage>(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());
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a4b3caf

Please sign in to comment.