diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-08-03 11:48:34 +0200 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-11-09 19:44:50 +0100 |
commit | fa6b053b5c964fb35935fa994cb782c0731a56f8 (patch) | |
tree | c9ba4d5a3b2771f596bb838d55c0e8e78699b454 /src/streams.h | |
parent | b3898e946cf81e2e7b573e1c5204bd29af2feecd (diff) |
mempool: persist with XOR
Diffstat (limited to 'src/streams.h')
-rw-r--r-- | src/streams.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/streams.h b/src/streams.h index d58de5233b..fe5df72abe 100644 --- a/src/streams.h +++ b/src/streams.h @@ -471,7 +471,7 @@ class AutoFile { protected: std::FILE* m_file; - const std::vector<std::byte> m_xor; + std::vector<std::byte> m_xor; public: explicit AutoFile(std::FILE* file, std::vector<std::byte> data_xor={}) : m_file{file}, m_xor{std::move(data_xor)} {} @@ -511,6 +511,9 @@ public: */ bool IsNull() const { return m_file == nullptr; } + /** Continue with a different XOR key */ + void SetXor(std::vector<std::byte> data_xor) { m_xor = data_xor; } + /** Implementation detail, only used internally. */ std::size_t detail_fread(Span<std::byte> dst); |