Bug fix: Update the instance variable self.lastDate (not the locally scoped variable lastDate)#9529
Closed
practicalswift wants to merge 1 commit intobitcoin:masterfrom
Closed
Conversation
…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.
Contributor
|
ACK |
Member
|
ACK. Also ping @droark You might be interested in this fix. |
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. |
Contributor
Author
|
@droark Please post your patch and I'll incorporate it :-) |
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? |
Contributor
|
@practicalswift - Filed #9580. This PR can be closed now. Thanks. |
Member
|
Thanks, closing in favor of #9580 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previous to this commit the instance variable
self.lastDatewas not updated as expected in the methodwriteBlock(...)of theBlockDataCopierclass. Instead the locally scoped variablelastDatewas updated.This resulted in
self.lastDatebeing kept constant at its initial valuedatetime.datetime(2000, 1, 1)during the lifetime of theBlockDataCopierobject, which in turn meant that the check ...... was effectively reduced to ...
... since
self.lastDatewas stuck at 2000-01-01.