mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-29 18:20:58 +02:00
Merge #21585: Fix assumeutxo crash due to truncated file
fa73ce6e65
Fix assumeutxo crash due to truncated file (MarcoFalke) Pull request description: ACKs for top commit: jamesob: ACKfa73ce6e65
ryanofsky: Code review ACKfa73ce6e65
. Easy fix. It seems like this could have been caught in review, though. Tree-SHA512: 3a98687c386e3995114ddf0ad7194fadd9520989290681ef703b578e3ca21aee51eadfb83aa38a489bac13d12709ea137b9b184b08e5bfa2919cca177aab90be
This commit is contained in:
@ -5198,12 +5198,12 @@ bool ChainstateManager::PopulateAndValidateSnapshot(
|
|||||||
while (coins_left > 0) {
|
while (coins_left > 0) {
|
||||||
try {
|
try {
|
||||||
coins_file >> outpoint;
|
coins_file >> outpoint;
|
||||||
|
coins_file >> coin;
|
||||||
} catch (const std::ios_base::failure&) {
|
} catch (const std::ios_base::failure&) {
|
||||||
LogPrintf("[snapshot] bad snapshot - no coins left after deserializing %d coins\n",
|
LogPrintf("[snapshot] bad snapshot format or truncated snapshot after deserializing %d coins\n",
|
||||||
coins_count - coins_left);
|
coins_count - coins_left);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
coins_file >> coin;
|
|
||||||
coins_cache.EmplaceCoinInternalDANGER(std::move(outpoint), std::move(coin));
|
coins_cache.EmplaceCoinInternalDANGER(std::move(outpoint), std::move(coin));
|
||||||
|
|
||||||
--coins_left;
|
--coins_left;
|
||||||
|
Reference in New Issue
Block a user