diff --git a/src/pow_hash.cpp b/src/pow_hash.cpp index 4b863be..3657506 100644 --- a/src/pow_hash.cpp +++ b/src/pow_hash.cpp @@ -382,8 +382,8 @@ RandomX_Hasher_RPC::RandomX_Hasher_RPC(p2pool* pool) // Init loop user data before running it GetLoopUserData(&m_loop); - uv_async_init(&m_loop, &m_shutdownAsync, on_shutdown); - uv_async_init(&m_loop, &m_kickTheLoopAsync, nullptr); + uv_async_init_checked(&m_loop, &m_shutdownAsync, on_shutdown); + uv_async_init_checked(&m_loop, &m_kickTheLoopAsync, nullptr); m_shutdownAsync.data = this; uv_mutex_init_checked(&m_requestMutex); diff --git a/src/side_chain.cpp b/src/side_chain.cpp index 3d57caf..038b39b 100644 --- a/src/side_chain.cpp +++ b/src/side_chain.cpp @@ -775,7 +775,9 @@ bool SideChain::get_outputs_blob(PoolBlock* block, uint64_t total_reward, std::v int index; while ((index = work->counter.fetch_sub(1)) >= 0) { uint8_t view_tag; - work->tmpShares[index].m_wallet->get_eph_public_key(work->txkeySec, static_cast(index), eph_public_key, view_tag); + if (!work->tmpShares[index].m_wallet->get_eph_public_key(work->txkeySec, static_cast(index), eph_public_key, view_tag)) { + LOGWARN(6, "get_eph_public_key failed at index " << index); + } } ++work->num_helper_jobs_finished; diff --git a/src/util.cpp b/src/util.cpp index 6a5e1bb..d239032 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -232,6 +232,15 @@ void uv_rwlock_init_checked(uv_rwlock_t* lock) } } +void uv_async_init_checked(uv_loop_t* loop, uv_async_t* async, uv_async_cb async_cb) +{ + const int err = uv_async_init(loop, async, async_cb); + if (err) { + LOGERR(1, "uv_async_init failed, error " << uv_err_name(err)); + panic(); + } +} + uv_loop_t* uv_default_loop_checked() { if (!is_main_thread()) { diff --git a/src/uv_util.h b/src/uv_util.h index 09747b5..c673486 100644 --- a/src/uv_util.h +++ b/src/uv_util.h @@ -60,6 +60,7 @@ typedef RWLock WriteLock; void uv_cond_init_checked(uv_cond_t* cond); void uv_mutex_init_checked(uv_mutex_t* mutex); void uv_rwlock_init_checked(uv_rwlock_t* lock); +void uv_async_init_checked(uv_loop_t* loop, uv_async_t* async, uv_async_cb async_cb); uv_loop_t* uv_default_loop_checked(); struct UV_LoopCallbackBase @@ -96,7 +97,7 @@ struct UV_LoopUserData , m_callbacks{} , m_callbacksToRun{} { - uv_async_init(m_loop, m_async, async_cb); + uv_async_init_checked(m_loop, m_async, async_cb); m_async->data = this; uv_mutex_init_checked(&m_callbacksLock);