Check content before zip/unzip the txhashset (#1174)

* Check txhashset content before zip/unzip
* Add header in txhashset verification
* Add copy function and test
* Add file util
* Now check and remove unexpected files instead of just crashing
This commit is contained in:
Quentin Le Sceller
2018-08-02 22:16:16 -04:00
committed by Ignotus Peverell
parent 3ee01055ed
commit 3df050cc93
11 changed files with 297 additions and 24 deletions
+8
View File
@@ -31,6 +31,14 @@ const PMMR_DATA_FILE: &'static str = "pmmr_data.bin";
const PMMR_LEAF_FILE: &'static str = "pmmr_leaf.bin";
const PMMR_PRUN_FILE: &'static str = "pmmr_prun.bin";
/// The list of PMMR_Files for internal purposes
pub const PMMR_FILES: [&str; 4] = [
PMMR_HASH_FILE,
PMMR_DATA_FILE,
PMMR_LEAF_FILE,
PMMR_PRUN_FILE,
];
/// PMMR persistent backend implementation. Relies on multiple facilities to
/// handle writing, reading and pruning.
///