mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-12 19:20:42 +02:00
Match Windows I/O priority to other platforms: loading external block files and reading blocks raw
This commit is contained in:
parent
8c989494c2
commit
67d111426a
@ -1049,7 +1049,7 @@ bool BlockManager::ReadBlockFromDisk(CBlock& block, const FlatFilePos& pos, cons
|
||||
return false;
|
||||
}
|
||||
|
||||
filein.SetIdlePriority();
|
||||
if (lowprio) filein.SetIdlePriority();
|
||||
|
||||
// Read block
|
||||
try {
|
||||
@ -1109,6 +1109,8 @@ bool BlockManager::ReadRawBlockFromDisk(std::vector<uint8_t>& block, const FlatF
|
||||
return false;
|
||||
}
|
||||
|
||||
if (lowprio) filein.SetIdlePriority();
|
||||
|
||||
try {
|
||||
MessageStartChars blk_start;
|
||||
unsigned int blk_size;
|
||||
|
@ -5038,6 +5038,7 @@ void ChainstateManager::LoadExternalBlockFile(
|
||||
int nLoaded = 0;
|
||||
try {
|
||||
IOPRIO_IDLER(/*lowprio=*/true);
|
||||
file_in.SetIdlePriority();
|
||||
|
||||
BufferedFile blkdat{file_in, 2 * MAX_BLOCK_SERIALIZED_SIZE, MAX_BLOCK_SERIALIZED_SIZE + 8};
|
||||
// nRewind indicates where to resume scanning in case something goes wrong,
|
||||
|
Loading…
Reference in New Issue
Block a user