mirror of
https://github.com/monero-project/monero.git
synced 2024-10-01 11:49:47 -04:00
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)
This commit is contained in:
commit
6c7d928f19
@ -606,12 +606,16 @@ eof:
|
|||||||
async_console_handler m_console_handler;
|
async_console_handler m_console_handler;
|
||||||
public:
|
public:
|
||||||
~console_handlers_binder() {
|
~console_handlers_binder() {
|
||||||
|
try
|
||||||
|
{
|
||||||
stop_handling();
|
stop_handling();
|
||||||
if (m_console_thread.get() != nullptr)
|
if (m_console_thread.get() != nullptr)
|
||||||
{
|
{
|
||||||
m_console_thread->join();
|
m_console_thread->join();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (const std::exception &e) { /* ignore */ }
|
||||||
|
}
|
||||||
|
|
||||||
bool start_handling(std::function<std::string(void)> prompt, const std::string& usage_string = "", std::function<void(void)> exit_handler = NULL)
|
bool start_handling(std::function<std::string(void)> prompt, const std::string& usage_string = "", std::function<void(void)> exit_handler = NULL)
|
||||||
{
|
{
|
||||||
|
@ -71,6 +71,7 @@ void threadpool::recycle() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void threadpool::create(unsigned int max_threads) {
|
void threadpool::create(unsigned int max_threads) {
|
||||||
|
const boost::unique_lock<boost::mutex> lock(mutex);
|
||||||
boost::thread::attributes attrs;
|
boost::thread::attributes attrs;
|
||||||
attrs.set_stack_size(THREAD_STACK_SIZE);
|
attrs.set_stack_size(THREAD_STACK_SIZE);
|
||||||
max = max_threads ? max_threads : tools::get_max_concurrency();
|
max = max_threads ? max_threads : tools::get_max_concurrency();
|
||||||
|
@ -1283,7 +1283,11 @@ namespace cryptonote
|
|||||||
fee = 0;
|
fee = 0;
|
||||||
|
|
||||||
//baseline empty block
|
//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;
|
size_t max_total_weight_pre_v5 = (130 * median_weight) / 100 - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE;
|
||||||
|
Loading…
Reference in New Issue
Block a user