Bug fix: Update the instance variable self.lastDate (not the locally scoped variable lastDate) #9529

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:fix-bug-in-BlockDataCopier changing 1 files +1 −1
  1. practicalswift commented at 4:23 PM on January 12, 2017: contributor

    Previous to this commit the instance variable self.lastDate was not updated as expected in the method writeBlock(...) of the BlockDataCopier class. Instead the locally scoped variable lastDate was updated.

    This resulted in self.lastDate being kept constant at its initial value datetime.datetime(2000, 1, 1) during the lifetime of the BlockDataCopier object, which in turn meant that the check ...

    if self.timestampSplit and (blkDate > self.lastDate):

    ... was effectively reduced to ...

    if self.timestampSplit:

    ... since self.lastDate was stuck at 2000-01-01.

  2. Bug fix: Update the instance variable self.lastDate (not the locally scoped variable lastDate)
    Previous to this commit the instance variable self.lastDate was not
    updated as expected in writeBlock(...). Instead the locally scoped
    variable lastDate was updated.
    
    This resulted in self.lastDate being kept constant at its initial
    value datetime.datetime(2000, 1, 1) during the lifetime of the
    BlockDataCopier object, which in turn meant that the check ...
    
        if self.timestampSplit and (blkDate > self.lastDate):
    
    ... was effectively reduced to ...
    
        if self.timestampSplit:
    
    ... since self.lastDate was stuck at 2000-01-01.
    76abd1b9ea
  3. jnewbery commented at 3:13 PM on January 17, 2017: member

    ACK

  4. MarcoFalke commented at 12:24 AM on January 18, 2017: member

    ACK. Also ping @droark You might be interested in this fix.

  5. droark commented at 12:41 AM on January 18, 2017: contributor

    @MarcoFalke - Thanks for the heads up. @practicalswift - Have you tested this? I had to alter a few lines before the script worked as expected. (Granted, I hadn't tested the code in question, so thanks!) I can post the patch and you can squash the commit.

  6. practicalswift commented at 9:02 AM on January 18, 2017: contributor

    @droark Please post your patch and I'll incorporate it :-)

  7. droark commented at 3:29 AM on January 19, 2017: contributor

    @practicalswift - Actually, since your patch just uncovers underlying issues, it's probably best for this PR to be closed and I file a larger PR that incorporates your fix. Cool?

  8. droark commented at 6:24 AM on January 19, 2017: contributor

    @practicalswift - Filed #9580. This PR can be closed now. Thanks.

  9. laanwj commented at 6:59 AM on January 19, 2017: member

    Thanks, closing in favor of #9580

  10. laanwj closed this on Jan 19, 2017

  11. practicalswift deleted the branch on Apr 10, 2021
  12. DrahtBot locked this on Aug 16, 2022

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-16 15:15 UTC

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