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