aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2020-03-31 15:14:12 -0500
committerluigi1111 <luigi1111w@gmail.com>2020-03-31 15:14:12 -0500
commit6c7d928f19b57e0e26ce580adf105d476a8760f2 (patch)
treee8f7e56bd94110bc6038cdb288e6bc6a48298b58 /src/cryptonote_core
parentMerge pull request #6325 (diff)
parenttx_pool: catch theoretical error in get_block_reward (diff)
downloadmonero-6c7d928f19b57e0e26ce580adf105d476a8760f2.tar.xz
Merge pull request #6336
760ecf2 console_handler: do not let exception past the dor (moneromooo-monero) 09c8111 threadpool: lock mutex in create (moneromooo-monero) e377977 tx_pool: catch theoretical error in get_block_reward (moneromooo-monero)
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 05cbf14a8..53a6ce579 100644
--- a/src/cryptonote_core/tx_pool.cpp
+++ b/src/cryptonote_core/tx_pool.cpp
@@ -1283,7 +1283,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;