From 7ff05358a96f49ae6b7eb265ce301748bfde30a8 Mon Sep 17 00:00:00 2001 From: Amiti Uttarwar Date: Mon, 4 Jan 2021 12:02:29 -0800 Subject: [PATCH] [mempool] Remove error suppression on upgrade 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. --- src/validation.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/validation.cpp b/src/validation.cpp index 2585345dee0..cc125a2a41a 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -5035,15 +5035,9 @@ bool LoadMempool(CTxMemPool& pool) pool.PrioritiseTransaction(i.first, i.second); } - // TODO: remove this try except in v0.22 std::set 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.