tx_pool: catch theoretical error in get_block_reward

Coverity 196626
This commit is contained in:
moneromooo-monero 2020-02-12 14:05:21 +00:00
parent 09c8111c53
commit e3779775d7
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3

View file

@ -1268,7 +1268,11 @@ namespace cryptonote
fee = 0;
//baseline empty block
get_block_reward(median_weight, total_weight, already_generated_coins, best_coinbase, version);
if (!get_block_reward(median_weight, total_weight, already_generated_coins, best_coinbase, version))
{
MERROR("Failed to get block reward for empty block");
return false;
}
size_t max_total_weight_pre_v5 = (130 * median_weight) / 100 - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE;