mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01:00
refactor: encapsulate vector/array keys into Obfuscation
This commit is contained in:
@@ -64,7 +64,7 @@ bool LoadMempool(CTxMemPool& pool, const fs::path& load_path, Chainstate& active
|
||||
if (version == MEMPOOL_DUMP_VERSION_NO_XOR_KEY) {
|
||||
file.SetObfuscation({});
|
||||
} else if (version == MEMPOOL_DUMP_VERSION) {
|
||||
std::vector<std::byte> obfuscation(Obfuscation::KEY_SIZE);
|
||||
Obfuscation obfuscation;
|
||||
file >> obfuscation;
|
||||
file.SetObfuscation(obfuscation);
|
||||
} else {
|
||||
@@ -183,8 +183,7 @@ bool DumpMempool(const CTxMemPool& pool, const fs::path& dump_path, FopenFn mock
|
||||
file << version;
|
||||
|
||||
if (!pool.m_opts.persist_v1_dat) {
|
||||
std::vector<std::byte> obfuscation(Obfuscation::KEY_SIZE);
|
||||
FastRandomContext{}.fillrand(obfuscation);
|
||||
const Obfuscation obfuscation{FastRandomContext{}.randbytes<Obfuscation::KEY_SIZE>()};
|
||||
file << obfuscation;
|
||||
file.SetObfuscation(obfuscation);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user