Skip to content

Commit f621392

Browse files
committed
assumeutxo: Check deserialized coins for out of range values
1 parent 6686544 commit f621392

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/validation.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5399,6 +5399,11 @@ bool ChainstateManager::PopulateAndValidateSnapshot(
53995399
coins_count - coins_left);
54005400
return false;
54015401
}
5402+
if (!MoneyRange(coin.out.nValue)) {
5403+
LogPrintf("[snapshot] bad snapshot data after deserializing %d coins - bad tx out value\n",
5404+
coins_count - coins_left);
5405+
return false;
5406+
}
54025407

54035408
coins_cache.EmplaceCoinInternalDANGER(std::move(outpoint), std::move(coin));
54045409

0 commit comments

Comments
 (0)