Fix threading violation in block cache loading

Pass nullptr instead of uv_default_loop_checked() when deserializing
  cached blocks at startup. This skips parallel key pre-computation
  during the one-time cache load, avoiding a threading check that was
  failing on macOS arm64.

  The parallel optimization is only used during cache loading - normal
  runtime block processing from peers is unaffected.
This commit is contained in:
Matt Hess
2025-12-24 20:13:40 +00:00
parent 5ce7dbf9f0
commit b226260f56
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -156,7 +156,7 @@ void BlockCache::load_all(SideChain& side_chain, P2PServer& server)
continue;
}
if (block.deserialize(block_data + sizeof(uint32_t), n, side_chain, uv_default_loop_checked(), false) == 0) {
if (block.deserialize(block_data + sizeof(uint32_t), n, side_chain, nullptr, false) == 0) {
server.add_cached_block(block);
++blocks_loaded;
}
@@ -378,7 +378,7 @@ void BlockCache::load_all(SideChain& side_chain, P2PServer& server)
continue;
}
if (block.deserialize(data + sizeof(uint32_t), n, side_chain, uv_default_loop_checked(), false) == 0) {
if (block.deserialize(data + sizeof(uint32_t), n, side_chain, nullptr, false) == 0) {
server.add_cached_block(block);
++blocks_loaded;
}
+3 -3
View File
@@ -182,8 +182,8 @@ static cmd cmds[] = {
{ STRCONST("peers"), "", "show all peers", do_showpeers },
{ STRCONST("workers"), "", "show all connected workers", do_showworkers },
{ STRCONST("bans"), "", "show all banned IPs", do_showbans },
{ STRCONST("hosts"), "", "show Monero hosts", do_showhosts },
{ STRCONST("next_host"), "", "switch to the next Monero host", do_nexthost },
{ STRCONST("hosts"), "", "show Salvium hosts", do_showhosts },
{ STRCONST("next_host"), "", "switch to the next Salvium host", do_nexthost },
{ STRCONST("outpeers"), "<N>", "set maximum number of outgoing connections", do_outpeers },
{ STRCONST("inpeers"), "<N>", "set maximum number of incoming connections", do_inpeers },
#ifdef WITH_RANDOMX
@@ -273,7 +273,7 @@ static void do_status(p2pool *m_pool, const char * /* args */)
if (tip && (data.height < tip->m_txinGenHeight)) {
node_health -= 5;
comments.push_back("Your Monero node is lagging");
comments.push_back("Your Salvium node is lagging");
}
if (stratum && (stratum->num_connections() == 0)) {