Use actual batch size for resize estimates

And optimize import startup:

Remember start_height position during initial count_blocks pass
to avoid having to reread entire file again to arrive at start_height
This commit is contained in:
Howard Chu 2017-09-17 00:12:42 +01:00
parent 7abdba0a5c
commit d2d8a41c47
No known key found for this signature in database
GPG key ID: FD2A70B44AB11BA7
8 changed files with 135 additions and 67 deletions

View file

@ -56,6 +56,8 @@ class BootstrapFile
{
public:
uint64_t count_bytes(std::ifstream& import_file, uint64_t blocks, uint64_t& h, bool& quit);
uint64_t count_blocks(const std::string& dir_path, streampos& start_pos, uint64_t& seek_height);
uint64_t count_blocks(const std::string& dir_path);
uint64_t seek_to_first_chunk(std::ifstream& import_file);