Skip to content

Commit 9c8a55d

Browse files
committed
[mempool] Don't throw expected error message when upgrading
1 parent ba54983 commit 9c8a55d

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/validation.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5067,12 +5067,18 @@ bool LoadMempool(CTxMemPool& pool)
50675067
pool.PrioritiseTransaction(i.first, i.second);
50685068
}
50695069

5070-
std::set<uint256> unbroadcast_txids;
5071-
file >> unbroadcast_txids;
5072-
unbroadcast = unbroadcast_txids.size();
5070+
// TODO: remove this try except in v0.22
5071+
try {
5072+
std::set<uint256> unbroadcast_txids;
5073+
file >> unbroadcast_txids;
5074+
unbroadcast = unbroadcast_txids.size();
50735075

5074-
for (const auto& txid : unbroadcast_txids) {
5076+
for (const auto& txid : unbroadcast_txids) {
50755077
pool.AddUnbroadcastTx(txid);
5078+
}
5079+
} catch (const std::exception&) {
5080+
// mempool.dat files created prior to v0.21 will not have an
5081+
// unbroadcast set. No need to log a failure if parsing fails here.
50765082
}
50775083

50785084
} catch (const std::exception& e) {

0 commit comments

Comments
 (0)