mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-13 03:30: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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
filein.SetIdlePriority();
|
if (lowprio) filein.SetIdlePriority();
|
||||||
|
|
||||||
// Read block
|
// Read block
|
||||||
try {
|
try {
|
||||||
@ -1109,6 +1109,8 @@ bool BlockManager::ReadRawBlockFromDisk(std::vector<uint8_t>& block, const FlatF
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (lowprio) filein.SetIdlePriority();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
MessageStartChars blk_start;
|
MessageStartChars blk_start;
|
||||||
unsigned int blk_size;
|
unsigned int blk_size;
|
||||||
|
@ -5038,6 +5038,7 @@ void ChainstateManager::LoadExternalBlockFile(
|
|||||||
int nLoaded = 0;
|
int nLoaded = 0;
|
||||||
try {
|
try {
|
||||||
IOPRIO_IDLER(/*lowprio=*/true);
|
IOPRIO_IDLER(/*lowprio=*/true);
|
||||||
|
file_in.SetIdlePriority();
|
||||||
|
|
||||||
BufferedFile blkdat{file_in, 2 * MAX_BLOCK_SERIALIZED_SIZE, MAX_BLOCK_SERIALIZED_SIZE + 8};
|
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,
|
// nRewind indicates where to resume scanning in case something goes wrong,
|
||||||
|
Loading…
Reference in New Issue
Block a user