mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-05 20:49:19 +01:00
refactor: Avoid integer overflow in ApplyStats when activating snapshot
This commit is contained in:
@@ -1244,7 +1244,8 @@ static RPCHelpMan gettxoutsetinfo()
|
||||
if (hash_type == CoinStatsHashType::MUHASH) {
|
||||
ret.pushKV("muhash", stats.hashSerialized.GetHex());
|
||||
}
|
||||
ret.pushKV("total_amount", ValueFromAmount(stats.nTotalAmount));
|
||||
CHECK_NONFATAL(stats.total_amount.has_value());
|
||||
ret.pushKV("total_amount", ValueFromAmount(stats.total_amount.value()));
|
||||
if (!stats.index_used) {
|
||||
ret.pushKV("transactions", static_cast<int64_t>(stats.nTransactions));
|
||||
ret.pushKV("disk_size", stats.nDiskSize);
|
||||
|
||||
Reference in New Issue
Block a user