Agree it could be a problem in theory, but I’d like to understand the problem better before making a change.
Right now I couldn’t find any places in our code that acquire cs_wallet while holding cs_main. To experiment I added LOCK(cs_main) to wallet/rpc/coins.cpp:197 and immediately this triggered our deadlock detection mechanism because it turns out that loadwallet rpc acquires lock in a different order (first cs_wallet and then cs_main).
What is our long-term direction with regards to using cs_main and cs_wallet together?
@achow101 any thoughts?
I’m also curious how we should think of these locks in light of multiprocess (cc @ryanofsky )