-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Fix csBestBlock/cvBlockChange waiting in rpc/mining #12743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Concept ACK! Much better than PR #11694 which I'm now closing :-) |
utACK 42be289. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 42be289df0c277777f7bbfc383ca7520140775cf. Nice simple bugfix.
src/validation.h
Outdated
extern CConditionVariable cvBlockChange; | ||
extern CWaitableCriticalSection cs_best_block; | ||
extern CConditionVariable cv_best_block_change; | ||
extern uint256 best_block_hash; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe prefix global variable name with g_
. (I would probably call these g_best_block
g_best_block_mutex
g_best_block_cv
.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
42be289
to
d1cbc67
Compare
utACK d1cbc67a. |
utACK, although would prefer the renaming was in a separate commit. |
d1cbc67
to
4a6c0e3
Compare
@luke-jr Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 4a6c0e3. Only change since last review renaming variables and splitting commit.
utACK 4a6c0e3 Travis timeout. Kicking. |
4a6c0e3 Modernize best block mutex/cv/hash variable naming (Pieter Wuille) 45dd135 Fix csBestBlock/cvBlockChange waiting in rpc/mining (Pieter Wuille) Pull request description: This is an alternative to #11694. It reintroduces a uint256 variable with the best block hash, protected by csBestBlock, and only updated while holding it. Also rename the involved variable to modern guidelines, as there are very few uses. Tree-SHA512: 826a86c7d3cee7fe49f99f4398ae99e81cb0563197eaeba77306a3ca6072b67cdb932bc35720fc0f99c2a57b218efa029d0b8bdfb240591a629b2e90efa3199d
Github-Pull: bitcoin#12743 Rebased-From: 45dd135
Github-Pull: bitcoin#12743 Rebased-From: 45dd135
Github-Pull: bitcoin#12743 Rebased-From: 45dd135
4a6c0e3 Modernize best block mutex/cv/hash variable naming (Pieter Wuille) 45dd135 Fix csBestBlock/cvBlockChange waiting in rpc/mining (Pieter Wuille) Pull request description: This is an alternative to bitcoin#11694. It reintroduces a uint256 variable with the best block hash, protected by csBestBlock, and only updated while holding it. Also rename the involved variable to modern guidelines, as there are very few uses. Tree-SHA512: 826a86c7d3cee7fe49f99f4398ae99e81cb0563197eaeba77306a3ca6072b67cdb932bc35720fc0f99c2a57b218efa029d0b8bdfb240591a629b2e90efa3199d
4a6c0e3 Modernize best block mutex/cv/hash variable naming (Pieter Wuille) 45dd135 Fix csBestBlock/cvBlockChange waiting in rpc/mining (Pieter Wuille) Pull request description: This is an alternative to bitcoin#11694. It reintroduces a uint256 variable with the best block hash, protected by csBestBlock, and only updated while holding it. Also rename the involved variable to modern guidelines, as there are very few uses. Tree-SHA512: 826a86c7d3cee7fe49f99f4398ae99e81cb0563197eaeba77306a3ca6072b67cdb932bc35720fc0f99c2a57b218efa029d0b8bdfb240591a629b2e90efa3199d
4a6c0e3 Modernize best block mutex/cv/hash variable naming (Pieter Wuille) 45dd135 Fix csBestBlock/cvBlockChange waiting in rpc/mining (Pieter Wuille) Pull request description: This is an alternative to bitcoin#11694. It reintroduces a uint256 variable with the best block hash, protected by csBestBlock, and only updated while holding it. Also rename the involved variable to modern guidelines, as there are very few uses. Tree-SHA512: 826a86c7d3cee7fe49f99f4398ae99e81cb0563197eaeba77306a3ca6072b67cdb932bc35720fc0f99c2a57b218efa029d0b8bdfb240591a629b2e90efa3199d
This is an alternative to #11694.
It reintroduces a uint256 variable with the best block hash, protected by csBestBlock, and only updated while holding it.
Also rename the involved variable to modern guidelines, as there are very few uses.