Author

Topic: [Linux Electrum] Why is "blockchain_headers" larger than it's Size on Disk? (Read 118 times)

legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
That's a Microsoft link, but you may be on to something: "sparse files" exist on ETX4 too. It looks like that's what Electrum is doing, there must be a lot of empty space in the file. That brings the next question: why not just delete the empty space?
It is indeed a sparse file. Electrum actually has a function that marks it as such in their util.py: https://github.com/spesmilo/electrum/blob/dfa0dd47b728d22a3b8143af4bdd1819a0997abd/electrum/util.py#L490.

A good bulk of the headers file consists of zeros, and they only need to store the headers beyond the latest checkpoint, CMIIW on this but that is how I remember it when checking out their codes. Might have to do with the way that they retrieve the headers, and thats why the zero data is necessary.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
The major answer to this is when there is automatic or inbuilt compression gotten from one’s operating system
Nope.

Quote
or again if the file in question is a sparse file
That's a Microsoft link, but you may be on to something: "sparse files" exist on ETX4 too. It looks like that's what Electrum is doing, there must be a lot of empty space in the file. That brings the next question: why not just delete the empty space?
hero member
Activity: 868
Merit: 952
Probably Compressed in some way?
Nope, my file system doesn't support compression.

The major answer to this is when there is automatic or inbuilt compression gotten from one’s operating system or again if the file in question is a sparse file
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Probably Compressed in some way?
Nope, my file system doesn't support compression.
hero member
Activity: 462
Merit: 767
Instant cryptocurrency exchange with own reserves!
See this image:
Image loading...
Electrum's file blockchain_headers is larger than the disk space it occupies (on a Linux system).
How can this be? Normally, files take slightly more space on disk (because of the disk block size), not less.

Probably Compressed in some way?
This is the only thing that might make sense.
I do not see any other possible way it can take less space.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
See this image:
Image loading...
Electrum's file blockchain_headers is larger than the disk space it occupies (on a Linux system).
How can this be? Normally, files take slightly more space on disk (because of the disk block size), not less.
Jump to: