diff --git a/src/node/miner.cpp b/src/node/miner.cpp index c1292149ef..3fc76d201d 100644 --- a/src/node/miner.cpp +++ b/src/node/miner.cpp @@ -767,7 +767,7 @@ void static ThreadStakeMiner(std::shared_ptr pwallet, NodeContext& m_no // peercoin: stake minter void MinePoS(bool fGenerate, std::shared_ptr pwallet, NodeContext& m_node) { - if (!pwallet->GetKeyPoolSize()) { + if (!WITH_LOCK(pwallet->cs_wallet, return pwallet->GetKeyPoolSize())) { LogPrintf("Error: Keypool is empty, please make sure the wallet contains keys and call keypoolrefill before restarting the mining thread\n"); fEnableStaking = false; return;