refactor: Remove no-op TIME_INIT on deser #25245

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:2205-no-time-deser-🌗 changing 2 files +2 −7
  1. MarcoFalke commented at 10:37 AM on May 30, 2022: member
  2. DrahtBot added the label P2P on May 30, 2022
  3. DrahtBot added the label Refactoring on May 30, 2022
  4. MarcoFalke force-pushed on May 30, 2022
  5. Remove no-op TIME_INIT on deser
    Assigning TIME_INIT to nTime was needed to fully re-initialize a dirty
    object where the deserialization might skip nTime.
    See https://github.com/bitcoin/bitcoin/pull/19020/files#r427620111
    
    Now that the without-nTime logic is removed in commit
    dbcb5742c48fd26f77e500291d7083e12eec741b and commit
    e08770bed187bfa66f525d42e484579bcea78bba, the logic here can be removed
    as well.
    
    Also, remove confusing and redundant preprocessor code.
    
    Also, remove no longer needed version.h include, which was needed for
    INIT_PROTO_VERSION.
    fa243e9313
  6. MarcoFalke force-pushed on May 30, 2022
  7. in src/bitcoin-util.cpp:18 in fa243e9313
      14 | @@ -15,6 +15,7 @@
      15 |  #include <streams.h>
      16 |  #include <util/system.h>
      17 |  #include <util/translation.h>
      18 | +#include <version.h>
    


    laanwj commented at 1:37 PM on May 30, 2022:

    Looks like an unrelated change snuck in here?


    MarcoFalke commented at 1:55 PM on May 30, 2022:

    No, the changes here wouldn't compile without this change.

    Commit dbcb5742c48fd26f77e500291d7083e12eec741b removed INIT_PROTO_VERSION from protocol.h, but didn't remove the version.h include from protocol, so I am doing that here.


    laanwj commented at 2:17 PM on May 30, 2022:

    Thanks, makes sense.

  8. fanquake approved
  9. fanquake commented at 1:22 PM on May 31, 2022: member

    ACK fa243e93138d899f41be02af3fa2b029dd8d525e

  10. laanwj commented at 4:52 PM on June 7, 2022: member

    ACK fa243e93138d899f41be02af3fa2b029dd8d525e

  11. laanwj merged this on Jun 7, 2022
  12. laanwj closed this on Jun 7, 2022

  13. MarcoFalke deleted the branch on Jun 7, 2022
  14. sidhujag referenced this in commit 1a5a74507f on Jun 8, 2022
  15. DrahtBot locked this on Jun 7, 2023

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-17 06:13 UTC

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