Fixed Coverity errors

This commit is contained in:
SChernykh 2024-06-23 23:51:47 +02:00
parent a75cf652de
commit 24f2ed2f81
2 changed files with 4 additions and 2 deletions

View file

@ -37,7 +37,9 @@ class RandomBytes
public:
RandomBytes() : rng(RandomDeviceSeed::instance), dist(0, 255)
{
uv_mutex_init_checked(&m);
if (uv_mutex_init(&m) != 0) {
abort();
}
// Diffuse the initial state in case it has low quality
rng.discard(10000);

View file

@ -178,7 +178,7 @@ void P2PServer::clear_cached_blocks()
return;
}
for (auto it : *m_cachedBlocks) {
for (const auto& it : *m_cachedBlocks) {
delete it.second;
}