bitcoind: support v28.0's new default "blk*.dat" xor'ing #130
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
bitcoind v28.0 added a new "feature" that, by default, xors all "blk*.dat" files on-disk with a random 8-byte key, saved to "xor.dat" on-disk. See: bitcoin/bitcoin#28052.
This diff adds support by first (1) reading the "xor.dat" key and then (2) xor'ing all "blk*.dat" files with it as we read them. If there is no "xor.dat" (old bitcoind version or disabled with the "-blocksxor=0" flag), then we don't do any xor'ing.
Compiling with latest stable also revealed that the "oldcpu" feature doesn't exist anymore, so I also removed those dead
#[cfg(feature = "oldcpu")]
blocks.You can easily test against v28.0 if you have
nix
installed:Running
test_electrum
without this patch: