Fix csBestBlock/cvBlockChange waiting in rpc/mining #12743

pull sipa wants to merge 2 commits into bitcoin:master from sipa:201803_waitblockchange changing 4 files +15 −9
  1. sipa commented at 4:06 am on March 21, 2018: member

    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.

  2. fanquake added the label RPC/REST/ZMQ on Mar 21, 2018
  3. practicalswift commented at 7:08 am on March 21, 2018: contributor
    Concept ACK! Much better than PR #11694 which I’m now closing :-)
  4. promag commented at 3:24 pm on March 21, 2018: member
    utACK 42be289.
  5. in src/validation.h:168 in 42be289df0 outdated
    162@@ -163,8 +163,9 @@ extern BlockMap& mapBlockIndex;
    163 extern uint64_t nLastBlockTx;
    164 extern uint64_t nLastBlockWeight;
    165 extern const std::string strMessageMagic;
    166-extern CWaitableCriticalSection csBestBlock;
    167-extern CConditionVariable cvBlockChange;
    168+extern CWaitableCriticalSection cs_best_block;
    169+extern CConditionVariable cv_best_block_change;
    170+extern uint256 best_block_hash;
    


    ryanofsky commented at 7:24 pm on April 3, 2018:
    Maybe prefix global variable name with g_. (I would probably call these g_best_block g_best_block_mutex g_best_block_cv.)

    sipa commented at 1:02 am on April 4, 2018:
    Fixed.
  6. ryanofsky commented at 7:26 pm on April 3, 2018: member
    utACK 42be289df0c277777f7bbfc383ca7520140775cf. Nice simple bugfix.
  7. sipa force-pushed on Apr 4, 2018
  8. promag commented at 1:15 am on April 4, 2018: member
    utACK d1cbc67a.
  9. luke-jr commented at 1:32 am on April 4, 2018: member
    utACK, although would prefer the renaming was in a separate commit.
  10. Fix csBestBlock/cvBlockChange waiting in rpc/mining 45dd135039
  11. Modernize best block mutex/cv/hash variable naming 4a6c0e3dcf
  12. sipa force-pushed on Apr 4, 2018
  13. sipa commented at 4:54 am on April 4, 2018: member
    @luke-jr Done.
  14. ryanofsky commented at 6:41 pm on April 4, 2018: member
    utACK 4a6c0e3dcfdca98270cb96b73db4c3d4446dba50. Only change since last review renaming variables and splitting commit.
  15. jnewbery commented at 8:42 pm on April 4, 2018: member

    utACK 4a6c0e3dcfdca98270cb96b73db4c3d4446dba50

    Travis timeout. Kicking.

  16. sipa merged this on Apr 13, 2018
  17. sipa closed this on Apr 13, 2018

  18. sipa referenced this in commit 4ba6da5574 on Apr 13, 2018
  19. MarcoFalke referenced this in commit ea5f16903d on Apr 20, 2018
  20. MarcoFalke referenced this in commit a25ef49dbf on May 24, 2018
  21. MarcoFalke referenced this in commit 69fbb83b63 on May 24, 2018
  22. MarcoFalke referenced this in commit a0d004a0a4 on May 29, 2018
  23. MarcoFalke referenced this in commit 657dfc5bca on Jul 13, 2018
  24. HashUnlimited referenced this in commit 0e4951f21a on Jan 11, 2019
  25. PastaPastaPasta referenced this in commit 1cfba98147 on Apr 12, 2020
  26. PastaPastaPasta referenced this in commit beb57b1333 on Apr 16, 2020
  27. PastaPastaPasta referenced this in commit e480ae9fa8 on Apr 16, 2020
  28. ckti referenced this in commit d5ee70493f on Mar 28, 2021
  29. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-10-04 22:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me