mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-03 09:56:38 -05: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:
commit
a12962ca89
1 changed files with 3 additions and 3 deletions
|
@ -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…
Add table
Reference in a new issue