diff options
author | Amiti Uttarwar <amiti@uttarwar.org> | 2020-04-28 10:42:01 -0700 |
---|---|---|
committer | Amiti Uttarwar <amiti@uttarwar.org> | 2020-05-25 11:27:07 -0700 |
commit | 9c8a55d9cb0ec73f10b196e79b637aa601c0a6b7 (patch) | |
tree | 115b5ccc83a650e6cf24d70039f0eee5112c44ff /src/validation.cpp | |
parent | ba5498318233ab81decbc585e9619d8ffe2df1b0 (diff) |
[mempool] Don't throw expected error message when upgrading
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index dbdf5028fd..396fc0a1b5 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -5067,12 +5067,18 @@ bool LoadMempool(CTxMemPool& pool) pool.PrioritiseTransaction(i.first, i.second); } - std::set<uint256> unbroadcast_txids; - file >> unbroadcast_txids; - unbroadcast = unbroadcast_txids.size(); + // TODO: remove this try except in v0.22 + try { + std::set<uint256> unbroadcast_txids; + file >> unbroadcast_txids; + unbroadcast = unbroadcast_txids.size(); - for (const auto& txid : unbroadcast_txids) { + for (const auto& txid : unbroadcast_txids) { pool.AddUnbroadcastTx(txid); + } + } 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. } } catch (const std::exception& e) { |