Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use iter after deletion. Fix compiler warning. #2508

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/txmempool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ void CTxMemPool::addUnchecked(const CTxMemPoolEntry &entry, setEntries &setAnces
void CTxMemPool::removeUnchecked(txiter it, MemPoolRemovalReason reason)
{
const auto& tx = it->GetTx();
const auto txType = it->GetCustomTxType();
NotifyEntryRemoved(it->GetSharedTx(), reason);
const uint256 hash = tx.GetHash();
for (const CTxIn& txin : tx.vin)
Expand All @@ -434,7 +435,6 @@ void CTxMemPool::removeUnchecked(txiter it, MemPoolRemovalReason reason)
mapLinks.erase(it);
mapTx.erase(it);

const auto txType = it->GetCustomTxType();
if (txType == CustomTxType::EvmTx || txType == CustomTxType::TransferDomain) {
auto found{false};
EvmAddressData sender{};
Expand Down
2 changes: 1 addition & 1 deletion src/txmempool.h
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ class CTxMemPool
indexed_transaction_set mapTx GUARDED_BY(cs);

std::map<EvmAddressData, std::set<uint256>> evmTxsBySender;
std::map<EvmAddressData, int> evmReplaceByFeeBySender;
std::map<EvmAddressData, uint32_t> evmReplaceByFeeBySender;

using txiter = indexed_transaction_set::nth_index<0>::type::const_iterator;
std::vector<std::pair<uint256, txiter>> vTxHashes GUARDED_BY(cs); //!< All tx witness hashes/entries in mapTx, in random order
Expand Down