Skip to content

Commit 0ad1066

Browse files
MarcoFalkePastaPastaPasta
authored andcommitted
Merge bitcoin#20854: [mempool] Remove unnecessary try-block
7ff0535 [mempool] Remove error suppression on upgrade (Amiti Uttarwar) Pull request description: In 0.21, we added unbroadcast txids to mempool.dat (bitcoin#18038). When users upgraded from 0.21 to 0.22, this would throw a misleading "failed to deserialize mempool data" error even though everything actually loaded properly. So, commit 9c8a55d added a try-block to prevent throwing the error. After upgrading to 0.22, this exception handling is no longer useful, so now we can remove it. ACKs for top commit: MarcoFalke: review ACK 7ff0535 theStack: Code review ACK 7ff0535 Tree-SHA512: 0444eea2b1326904f9855fd0af6669a4990f0427cf7c9293252a5b7049cdcc785bdf9398fd08ed8dedacfdd78e75039ddf1087b3654c558ff52498df15f05daf
1 parent 9c2aefe commit 0ad1066

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/validation.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5596,15 +5596,9 @@ bool LoadMempool(CTxMemPool& pool, CChainState& active_chainstate, FopenFn mocka
55965596
pool.PrioritiseTransaction(i.first, i.second);
55975597
}
55985598

5599-
// TODO: remove this try except in v0.22
56005599
std::set<uint256> unbroadcast_txids;
5601-
try {
5602-
file >> unbroadcast_txids;
5603-
unbroadcast = unbroadcast_txids.size();
5604-
} catch (const std::exception&) {
5605-
// mempool.dat files created prior to v0.21 will not have an
5606-
// unbroadcast set. No need to log a failure if parsing fails here.
5607-
}
5600+
file >> unbroadcast_txids;
5601+
unbroadcast = unbroadcast_txids.size();
56085602
for (const auto& txid : unbroadcast_txids) {
56095603
// Ensure transactions were accepted to mempool then add to
56105604
// unbroadcast set.

0 commit comments

Comments
 (0)