diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-04-03 17:13:17 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-04-03 17:52:58 +0200 |
commit | fa73ce6e653d00824eb68f772fd29b7f8fb93d84 (patch) | |
tree | e112126771e3853fb3e96291c72ac8fff68df737 /src/validation.cpp | |
parent | ad4bf8a94594e7fe424e409ba9474d91584bb78c (diff) |
Fix assumeutxo crash due to truncated file
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 19363c0efb..c62e201a67 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -5345,12 +5345,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; |