diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-04-14 15:12:11 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-04-14 15:12:14 +0200 |
commit | a12962ca894075ae203ab808db4ba5dab23346d1 (patch) | |
tree | f0165c93de3ca3195031655ff33175d06c8b1d8c /src | |
parent | 03ecceedf6f15d2062e95b4533c5cea092c4c696 (diff) | |
parent | fa73ce6e653d00824eb68f772fd29b7f8fb93d84 (diff) | |
download | bitcoin-a12962ca894075ae203ab808db4ba5dab23346d1.tar.xz |
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
Diffstat (limited to 'src')
-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 47a4a1fcb4..332cb581b8 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -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; |