mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
Merge #20854: [mempool] Remove unnecessary try-block
7ff05358a9
[mempool] Remove error suppression on upgrade (Amiti Uttarwar) Pull request description: In 0.21, we added unbroadcast txids to mempool.dat (#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, commit9c8a55d
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 ACK7ff05358a9
theStack: Code review ACK7ff05358a9
Tree-SHA512: 0444eea2b1326904f9855fd0af6669a4990f0427cf7c9293252a5b7049cdcc785bdf9398fd08ed8dedacfdd78e75039ddf1087b3654c558ff52498df15f05daf
This commit is contained in:
commit
c37600777e
1 changed files with 2 additions and 8 deletions
|
@ -5035,15 +5035,9 @@ bool LoadMempool(CTxMemPool& pool)
|
||||||
pool.PrioritiseTransaction(i.first, i.second);
|
pool.PrioritiseTransaction(i.first, i.second);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: remove this try except in v0.22
|
|
||||||
std::set<uint256> unbroadcast_txids;
|
std::set<uint256> unbroadcast_txids;
|
||||||
try {
|
file >> unbroadcast_txids;
|
||||||
file >> unbroadcast_txids;
|
unbroadcast = unbroadcast_txids.size();
|
||||||
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.
|
|
||||||
}
|
|
||||||
for (const auto& txid : unbroadcast_txids) {
|
for (const auto& txid : unbroadcast_txids) {
|
||||||
// Ensure transactions were accepted to mempool then add to
|
// Ensure transactions were accepted to mempool then add to
|
||||||
// unbroadcast set.
|
// unbroadcast set.
|
||||||
|
|
Loading…
Add table
Reference in a new issue