From 79eccb632caf2c085ae470d442d88aa91e814821 Mon Sep 17 00:00:00 2001 From: backpacker69 Date: Fri, 1 Sep 2023 13:33:09 +1000 Subject: [PATCH] wallet, pos: Add lock of cs_wallet https://github.com/peercoin/peercoin/commit/2e71fa9608d2a06ff396cba26bb09484827c09fa --- src/node/miner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;