Changeset View
Changeset View
Standalone View
Standalone View
src/blockdb.cpp
#include <blockdb.h> | #include <blockdb.h> | ||||
#include <blockindex.h> | #include <blockindex.h> | ||||
#include <clientversion.h> | #include <clientversion.h> | ||||
#include <pow/pow.h> | #include <pow/pow.h> | ||||
#include <primitives/block.h> | #include <primitives/block.h> | ||||
#include <streams.h> | #include <streams.h> | ||||
#include <util/system.h> | #include <util/system.h> | ||||
extern RecursiveMutex cs_main; | extern RecursiveMutex cs_main; | ||||
FlatFileSeq BlockFileSeq() { | FlatFileSeq BlockFileSeq() { | ||||
return FlatFileSeq(gArgs.GetBlocksDirPath(), "blk", BLOCKFILE_CHUNK_SIZE); | return FlatFileSeq(gArgs.GetBlocksDirPath(), "blk", | ||||
gArgs.GetBoolArg("-fastprune", false) | |||||
? 0x4000 /* 16kb */ | |||||
: BLOCKFILE_CHUNK_SIZE); | |||||
} | } | ||||
FlatFileSeq UndoFileSeq() { | FlatFileSeq UndoFileSeq() { | ||||
return FlatFileSeq(gArgs.GetBlocksDirPath(), "rev", UNDOFILE_CHUNK_SIZE); | return FlatFileSeq(gArgs.GetBlocksDirPath(), "rev", UNDOFILE_CHUNK_SIZE); | ||||
} | } | ||||
FILE *OpenBlockFile(const FlatFilePos &pos, bool fReadOnly) { | FILE *OpenBlockFile(const FlatFilePos &pos, bool fReadOnly) { | ||||
return BlockFileSeq().Open(pos, fReadOnly); | return BlockFileSeq().Open(pos, fReadOnly); | ||||
▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines |