Fixes #6613 (discussion here: #4069)
Obfuscate the leveldb-stored chainstate with a simple XOR to avoid spurious detection by anti-virus software.
Chainstate obfuscation will happen atomically, i.e. either all or none of the database will be obfuscated. A runtime error will be thrown if a user attempts to invoke bitcoind -obfuscatechaindata
with existing, unobfuscated chainstate data.
On reindexing, all new chainstates will be obfuscated. until then, we specify a degenerate obfuscation key (\000\000...
) that has no effect when XOR’d with existing data.
TODO after Concept ACK
- write tests covering
CDataStream.Xor
- write tests covering obfuscation ops with
CLevelDBWrapper