mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-17 02:57:33 +02:00
streams: cache file position within AutoFile
This commit is contained in:
@@ -203,10 +203,10 @@ std::vector<bool> DecodeAsmap(fs::path path)
|
||||
LogPrintf("Failed to open asmap file from disk\n");
|
||||
return bits;
|
||||
}
|
||||
fseek(filestr, 0, SEEK_END);
|
||||
int length = ftell(filestr);
|
||||
file.seek(0, SEEK_END);
|
||||
int length = file.tell();
|
||||
LogPrintf("Opened asmap file %s (%d bytes) from disk\n", fs::quoted(fs::PathToString(path)), length);
|
||||
fseek(filestr, 0, SEEK_SET);
|
||||
file.seek(0, SEEK_SET);
|
||||
uint8_t cur_byte;
|
||||
for (int i = 0; i < length; ++i) {
|
||||
file >> cur_byte;
|
||||
|
||||
Reference in New Issue
Block a user