Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Genesis block should be scanned when next scan range #1141

Merged
merged 1 commit into from
Nov 18, 2019

Conversation

ashchan
Copy link
Contributor

@ashchan ashchan commented Nov 17, 2019

starts from block #1

This bug is very interesting.

The block queue scans a window of blocks in batch. It remembers the last scanned block N, and starts from N + 1 for next round.

N was initialized as -1 then the first round would start from genesis block.

But initially it also reads another DB saved number representing last block number. When Neuron launches without any wallets, that number will be zero and persisted.

Then when a wallet gets imported the queue scans from 1, not genesis block!

Yet to see if this guard fixes completely. It seems too difficult to change the scan range and remove the N + 1 operation, though.

@ashchan ashchan merged commit d354a7d into develop Nov 18, 2019
@ashchan ashchan deleted the fix-genesis-txs-scan-bug branch December 2, 2019 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants