Fix potential deadlock - #506
Conversation
|
utACK |
|
compiling and testing now. |
proletesseract
left a comment
There was a problem hiding this comment.
Compiles and runs on ubuntu 18.04. Test suite runs. Not entirely sure exactly how to test this specific change. Code looks fine. Can you perhaps just explain in a bit more detail what was wrong and what you did to fix it? If I understand correctly, having the cold staking check where it was before could cause a conflict in how the thread locking occurs resulting in this algorithm being unable to proceed?
|
IsColdStakingEnabled() locked cs_main while CheckTransaction() locks cs_wallet, so every call to CheckTransaction() was locking in the order cs_wallet,cs_main conflicting with the lock order from wallet/wallet.cpp:1965 which runs in parallel in other thread |
mxaddict
left a comment
There was a problem hiding this comment.
Tested Ubuntu 18.04 ran node for 26 hours
This PR fixes a potential deadlock moving IsColdStakingEnabled() out of CheckTransaction().