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: reset leaf node bitmap on flush #24

Merged

Conversation

rvagg
Copy link
Member

@rvagg rvagg commented Jul 30, 2020

Flush() rebuilds the serializable form of the node and, setting the Values array for leaves and Links for non-leaves, in the process it sets up the bitmap again for each set element. On the non-leaf nodes we get a fresh bitmap to work with but the same is not done on leaf nodes.

I'm not convinced this is strictly necessary since setBit() and clearBit() are called on mutations elsewhere, but as long as we're doing a fresh rebuild and it's being done for non-leaf nodes, this should be done here to be absolutely sure, otherwise the n.setBit(i) isn't necessary either.

amt.go Outdated Show resolved Hide resolved
@ZenGround0 ZenGround0 merged commit 53702e7 into filecoin-project:master Aug 31, 2020
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.

None yet

3 participants