Skip to content

Commit

Permalink
[mempool] Remove error suppression on upgrade
Browse files Browse the repository at this point in the history
In 0.21, we added unbroadcast txids to mempool.dat. Commit 9c8a55d
added a try-block to prevent throwing a "failed to deserialize mempool data"
error when a user upgrades from 0.21 to 0.22. This exception handling is no
longer useful, so now we can remove it.
  • Loading branch information
amitiuttarwar committed Jan 4, 2021
1 parent bc8ada1 commit 7ff0535
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5035,15 +5035,9 @@ bool LoadMempool(CTxMemPool& pool)
pool.PrioritiseTransaction(i.first, i.second);
}

// TODO: remove this try except in v0.22
std::set<uint256> unbroadcast_txids;
try {
file >> unbroadcast_txids;
unbroadcast = unbroadcast_txids.size();
} catch (const std::exception&) {
// mempool.dat files created prior to v0.21 will not have an
// unbroadcast set. No need to log a failure if parsing fails here.
}
file >> unbroadcast_txids;
unbroadcast = unbroadcast_txids.size();
for (const auto& txid : unbroadcast_txids) {
// Ensure transactions were accepted to mempool then add to
// unbroadcast set.
Expand Down

0 comments on commit 7ff0535

Please sign in to comment.