Skip to content

Commit

Permalink
LoadExternalBlockFile: Set low I/O priority
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-jr committed Sep 12, 2021
1 parent c41b5d6 commit 6de915d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include <undo.h>
#include <util/check.h> // For NDEBUG compile time check
#include <util/hasher.h>
#include <util/ioprio.h>
#include <util/moneystr.h>
#include <util/rbf.h>
#include <util/strencodings.h>
Expand Down Expand Up @@ -4164,6 +4165,8 @@ void CChainState::LoadExternalBlockFile(FILE* fileIn, FlatFilePos* dbp)

int nLoaded = 0;
try {
IOPRIO_IDLER(/* lowprio */ true);

// This takes over fileIn and calls fclose() on it in the CBufferedFile destructor
CBufferedFile blkdat(fileIn, 2*MAX_BLOCK_SERIALIZED_SIZE, MAX_BLOCK_SERIALIZED_SIZE+8, SER_DISK, CLIENT_VERSION);
uint64_t nRewind = blkdat.GetPos();
Expand Down

0 comments on commit 6de915d

Please sign in to comment.