[2.x.x] simplify txhashset zip creation and extraction #2908
This PR aims to simplify and improve a couple of implementation details around our txhashset zip handling.
Primary motivation here was to introduce some flexibility in the set of acceptable/expected files in the
We don't need the kernel hash file (we can rebuild it from the kernel data file) and we can save approx 45MB by excluding it.
Currently it is hard to exclude it when building the zip file without introducing a lot of code.
This PR makes the list of files more explicit so we could modify this list for protocol version 2 for example.
We currently do the following -
We do not need to craft a regex to support these. We can simply define a list of file paths. These are the only files that will be included in the zip when creating it. These are the only files that will be extracted from the zip file when receiving it.
Additional improvements -
Sample output receiving a zip. We only look for these exact files in the zip and we expect the paths in the zip to match exactly. No attempt will be made to extract anything not matching any of these exact paths.
DavidBurkett left a comment
I can't test at the moment, but we'll want to make sure this gets tested in Windows too before merging. It seems every change we make to this code breaks windows due to the file system differences (path separators, allowed filenames, etc).