[trivial] Rephrase the definition of difficulty. #9612

pull kallewoof wants to merge 1 commits into bitcoin:master from kallewoof:clarify-difficulty changing 1 files +7 −2
  1. kallewoof commented at 1:14 AM on January 23, 2017: member

    Difficulty is defined as a multiple of the minimum difficulty, but it is not clear that this in reality means the main net difficulty, not the difficulty of the active net.

    See #9597.

  2. fanquake added the label Docs and Output on Jan 23, 2017
  3. in src/rpc/blockchain.cpp:None in 0a4f02bbe8 outdated
      44 | @@ -45,8 +45,8 @@ void ScriptPubKeyToJSON(const CScript& scriptPubKey, UniValue& out, bool fInclud
      45 |  
      46 |  double GetDifficulty(const CBlockIndex* blockindex)
      47 |  {
      48 | -    // Floating point number that is a multiple of the minimum difficulty,
      49 | -    // minimum difficulty = 1.0.
      50 | +    // Floating point number that is a multiple of the main net minimum
    


    laanwj commented at 9:02 AM on February 2, 2017:

    Would be even better to turn it into a doxygen comment and move it outside the function. E.g.

    /** Returns a floating point number that is a multiple of the main net minimum
     * difficulty (4295032833 hashes).
     */
    double GetDifficulty(const CBlockIndex* blockindex)
    ...
    

    kallewoof commented at 2:07 PM on February 2, 2017:

    Gladly!

  4. kallewoof force-pushed on Feb 2, 2017
  5. luke-jr commented at 7:47 PM on February 2, 2017: member

    utACK, but prefer "original mainnet difficulty" in case we bump up the minimum someday.

  6. kallewoof commented at 9:04 PM on February 2, 2017: member

    We wouldn't update the constants if the value they're based on changed?

  7. jtimon commented at 2:03 AM on February 24, 2017: contributor

    utACK Perhaps use doxygen's @return ?

  8. sipa commented at 3:23 AM on February 24, 2017: member

    utACK

  9. kallewoof force-pushed on Feb 24, 2017
  10. kallewoof commented at 4:43 AM on February 24, 2017: member

    @jtimon Makes sense. Updated.

  11. kallewoof force-pushed on Feb 24, 2017
  12. Trivial: Rephrase the definition of difficulty in the code. dc222f8f63
  13. kallewoof force-pushed on Feb 24, 2017
  14. jonasschnelli approved
  15. jonasschnelli commented at 7:17 AM on February 24, 2017: contributor

    utACK dc222f8f634d5bb82d4646f9a17f0d40a60bcf60

  16. laanwj merged this on Feb 24, 2017
  17. laanwj closed this on Feb 24, 2017

  18. laanwj referenced this in commit f19afdbfb4 on Feb 24, 2017
  19. PastaPastaPasta referenced this in commit 0a0f355a62 on Dec 28, 2018
  20. PastaPastaPasta referenced this in commit efd171dfdf on Dec 29, 2018
  21. PastaPastaPasta referenced this in commit e705b58a2d on Dec 29, 2018
  22. PastaPastaPasta referenced this in commit ffe4c20c18 on Dec 29, 2018
  23. PastaPastaPasta referenced this in commit 7d98d6e75a on Jan 2, 2019
  24. PastaPastaPasta referenced this in commit b91574b0b0 on Jan 3, 2019
  25. PastaPastaPasta referenced this in commit c300750665 on Jan 3, 2019
  26. UdjinM6 referenced this in commit 07dcddb4ca on Jan 7, 2019
  27. kallewoof deleted the branch on Oct 17, 2019
  28. DrahtBot locked this on Dec 16, 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: 2026-04-13 15:15 UTC

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