aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2020-02-12 14:05:21 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2020-02-12 21:05:28 +0000
commite3779775d77a986d90f47708570bc1d6de26d5e7 (patch)
tree2ceeec7c2ac6e9b29061c98424e12fc6a4862ae2 /src/cryptonote_core
parentthreadpool: lock mutex in create (diff)
downloadmonero-e3779775d77a986d90f47708570bc1d6de26d5e7.tar.xz
tx_pool: catch theoretical error in get_block_reward
Coverity 196626
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r--src/cryptonote_core/tx_pool.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp
index 1bc475879..13320e69f 100644
--- a/src/cryptonote_core/tx_pool.cpp
+++ b/src/cryptonote_core/tx_pool.cpp
@@ -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;