You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been working on some changes in a forked repository and was having problems with, after some several hundred blocks, templates being made with zero target Bits. I searched around using the handy trace logging system I created to try and find where the problem was originating, and eventually stumbled onto this function.
It appears that this mutex is locked prematurely, by moving the lock and defer down to the first instance of the actual access to the b.Chain the bug completely disappeared. If nobody can see any reason why to not also do this to the btcd codebase as well, as I expect the mining functionality of btcd hasn't been exercised very much, then it should be because it resolved a problem that clearly must have been caused by improper synchronisation.
The text was updated successfully, but these errors were encountered:
btcd/blockchain/validate.go
Line 1247 in 991d32e
I have been working on some changes in a forked repository and was having problems with, after some several hundred blocks, templates being made with zero target Bits. I searched around using the handy trace logging system I created to try and find where the problem was originating, and eventually stumbled onto this function.
It appears that this mutex is locked prematurely, by moving the lock and defer down to the first instance of the actual access to the b.Chain the bug completely disappeared. If nobody can see any reason why to not also do this to the btcd codebase as well, as I expect the mining functionality of btcd hasn't been exercised very much, then it should be because it resolved a problem that clearly must have been caused by improper synchronisation.
The text was updated successfully, but these errors were encountered: