-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
LinkSize > 0 even when NumLinks === 0 #2260
Comments
See https://github.com/ipfs/go-ipfs/blob/06cb9b5813a2fb15d57267bc72268ffbe32ea796/merkledag/node.go#L239 for how the The protobuf marshal additionally adds offset with https://github.com/ipfs/go-ipfs/blob/06cb9b5813a2fb15d57267bc72268ffbe32ea796/merkledag/pb/merkledag.pb.go#L556. |
oh, I see. Thank you @rht :) |
(I'd consider it a bug. |
yeah, that doesnt seem right to me. the comment is vague, i'm not sure what is meant to 'include framing'. with zero links, linksize should be zero |
This should be resolved now. The links field is normalized to be null if no links are present. The two bytes was caused by a non-null but zero length links array in the protobuf |
So, just to be sure, do we put an empty array on the protobuf taking those couple of bytes? |
Is there any reason I'm missing on why it is
2
?The text was updated successfully, but these errors were encountered: