3

My understanding of bitcoinj is that it is used to implement a "thin client" that doesn't store the entire blockchain- just the headers.

When I use the WalletAppKit, it creates a file "default.spvchain" that is 626Kib. This could easily fit in memory, so why is SPVBlockStore (using memory mapped file) used? Wouldn't MemoryBlockStore be a better choice?

1 Answer 1

1

If you don't persist the headers in some way then you'd have to reload them each time you launched. Loading the headers from scratch isn't a free operation. Its not just a matter of downloading 626k. It may be a small amount of data in the end but each header still needs to be verified (targets calculated and checked, etc). Not only that, but there are less obvious privacy implications of requesting the block chain from the network each time.

SPVBlockStore still uses memory mapped IO so its not like you take a performance hit, it just makes subsequent launches of the software faster.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.