Comments: More comments on functions/globals in standard.h. #11058

pull jimpo wants to merge 1 commits into bitcoin:master from jimpo:standard-comments changing 2 files +58 −7
  1. jimpo commented at 1:25 am on August 16, 2017: contributor
    I was confused about what “data carrier” meant, so I wanted to comment the fAcceptDatacarrier and nMaxDatacarrierBytes fields specifically. Then I figured I’d add docs for the rest of the functions.
  2. fanquake added the label Docs and Output on Aug 16, 2017
  3. in src/script/standard.h:89 in 85dc710354 outdated
    80@@ -70,15 +81,49 @@ class CNoDestination {
    81  */
    82 typedef boost::variant<CNoDestination, CKeyID, CScriptID> CTxDestination;
    83 
    84+/** Get the name of a txnouttype as a C string, or nullptr if unknown. */
    85 const char* GetTxnOutputType(txnouttype t);
    86 
    87+/**
    88+ * Parse a scriptPubKey and identify script type for standard scripts. Assigns
    89+ * the result to the typeRet reference parameter and returns true if successful.
    


    TheBlueMatt commented at 4:17 pm on August 17, 2017:
    Looks like you lost the stuff noting what vSolutionsRet is when you moved the comment from standard.cpp.

    jnewbery commented at 6:01 pm on August 17, 2017:
    (specifically that vSolutionsRet is a vector of the public keys or hashes from the scriptPubKey)
  4. in src/script/standard.h:42 in 85dc710354 outdated
    38+ * A data carrying output is an unspendable output containing data. The script
    39+ * type is designated as TX_NULL_DATA.
    40+ */
    41 extern bool fAcceptDatacarrier;
    42+
    43+/** Maximum size of TX_NULL_DATA scripts that this node considers standard. */
    


    TheBlueMatt commented at 4:22 pm on August 17, 2017:
    (per transaction)

    jimpo commented at 6:56 pm on August 17, 2017:
    I’m not sure if that’s necessary to add here. This is the byte limit for OP_RETURN scripts, then IsStandardTx further restricts the number of OP_RETURN outputs per tx to 1. If this comment were to say per transaction it sort of implies that the data can be split across multiple OP_RETURN outputs as long as the limit is not exceeded.

    TheBlueMatt commented at 1:32 am on August 21, 2017:
    Ahh, missed that it was applied per-scriptPubKey and had an independant per-tx limit, yea, fine as-is.
  5. in src/script/standard.h:101 in 85dc710354 outdated
    89+ * the result to the typeRet reference parameter and returns true if successful.
    90+ */
    91 bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, std::vector<std::vector<unsigned char> >& vSolutionsRet);
    92+
    93+/**
    94+ * Parse a standard scriptPubKey for the destination address. Assigns result to
    


    TheBlueMatt commented at 4:23 pm on August 17, 2017:
    Maybe note that this only works on some standard scriptPubKey types (eg currently does not work on segwit types, nor null_data, for obvious reasons).

    jimpo commented at 7:00 pm on August 17, 2017:
    Happy to add if you prefer, but that seems like something that the implementation might change. Is it possible that a new CTxDestination for witness programs will be added? It’s also interesting that this function does not return a CNoDestination for TX_NULL_DATA scripts.

    TheBlueMatt commented at 1:33 am on August 21, 2017:
    Sure, but we can also update the comment when the implementation changes to support more :)
  6. TheBlueMatt commented at 4:24 pm on August 17, 2017: member
    Thanks for this!
  7. jimpo force-pushed on Aug 17, 2017
  8. Comments: More comments on functions/globals in standard.h. 360b464a08
  9. jimpo force-pushed on Aug 18, 2017
  10. TheBlueMatt commented at 1:36 am on August 21, 2017: member
    ACK 360b464a08ac42a9a249b34c1a780ada2d4f610a
  11. laanwj commented at 7:31 am on August 22, 2017: member
    ACK 360b464, thanks for adding documentation
  12. laanwj merged this on Aug 22, 2017
  13. laanwj closed this on Aug 22, 2017

  14. laanwj referenced this in commit 4b65fa5921 on Aug 22, 2017
  15. jimpo deleted the branch on Sep 1, 2017
  16. PastaPastaPasta referenced this in commit 5ee2fdfd2f on Sep 19, 2019
  17. PastaPastaPasta referenced this in commit af3f1a68e8 on Sep 23, 2019
  18. PastaPastaPasta referenced this in commit bc45fe3785 on Sep 24, 2019
  19. PastaPastaPasta referenced this in commit 07d41f9e43 on Nov 19, 2019
  20. PastaPastaPasta referenced this in commit 6ff6f08210 on Nov 21, 2019
  21. PastaPastaPasta referenced this in commit bac24a5b56 on Dec 9, 2019
  22. zkbot referenced this in commit 63c3d1ec94 on Dec 17, 2019
  23. PastaPastaPasta referenced this in commit 769817fa11 on Jan 1, 2020
  24. PastaPastaPasta referenced this in commit e86aa98259 on Jan 2, 2020
  25. PastaPastaPasta referenced this in commit 7253eb2829 on Jan 2, 2020
  26. ckti referenced this in commit 17df74b446 on Mar 28, 2021
  27. gades referenced this in commit a41e2ea71a on Jun 26, 2021
  28. 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-12-04 06:12 UTC

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