bitcoin-pow / BitcoinPoW

BitcoinPoW
https://bitcoin-pow.org
MIT License
12 stars 5 forks source link

getstakingstatus hangs #9

Closed bitcoin-pow closed 5 months ago

bitcoin-pow commented 5 months ago

calling the rpc method 'getstakingstatus' multiple times, sometimes just once, results in the method hanging. Need to understand why and fix it. Should be able to call one billion times without it breaking.

bitcoin-pow commented 5 months ago

Code hangs inside of:

LOCK(cs_main); LOCK(pwallet->cs_wallet); <-----Hangs deep inside here, __gthrw glibc recursive, just hangs

========= Fix was to perform the wallet logic first, get out of wallet lock scope, then perform the logic with the cs_main lock.

getstakingstatus getstakinginfo getmininginfo

All had same type of fix.

Tested variations of the 3 rpc calls with and without mining enabled. 50 calls in a row work now. Prior to fix, one or two calls to these methods would hang the runtime forever.

I'm calling this issue resolved.