getinfo rpc needs a cs_wallet lock

Without it we get an AssertLockHeld when calling GetKeyPoolSize .
We could probably make this lock apply to less code, possibly only
the single line that calls GetKeyPoolSize() needs it.
This commit is contained in:
Duke
2024-09-13 04:37:48 -04:00
parent 6845fcd93a
commit f5cae3b403

View File

@@ -231,11 +231,12 @@ UniValue getinfo(const UniValue& params, bool fHelp, const CPubKey& mypk)
+ HelpExampleCli("getinfo", "")
+ HelpExampleRpc("getinfo", "")
);
//#ifdef ENABLE_WALLET
// LOCK2(cs_main, pwalletMain ? &pwalletMain->cs_wallet : NULL);
//#else
#ifdef ENABLE_WALLET
LOCK2(cs_main, pwalletMain ? &pwalletMain->cs_wallet : NULL);
#else
LOCK(cs_main);
//#endif
#endif
proxyType proxy;
GetProxy(NET_IPV4, proxy);