Why sort links in pbnode

In the implementation of merkledag, the dag node will be serialized as protobuf node(PBNode). I saw in the code, the links are sorted:

sort.Stable(LinkSlice(n.links))

But the question is when we add a big file, the file will be split into multiple nodes that linked together. If the order of the links are changed by sorting, how can we make sure get the correct order of file pieces?

Thanks!

We sort by names and chunk nodes aren’t named (so the stable sort doesn’t move anything).

I got it! Thanks a lot !