diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2012-10-21 21:23:13 +0200 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2012-11-09 01:06:32 +0100 |
commit | 7fea48467442079cd0b4021b580761d7e33fa8a1 (patch) | |
tree | b750e95c08a92a39df49a3325c1f124a3e2c7744 /src/main.h | |
parent | 7a5b7535bf3b987c5e2157f25c8b3246033d952e (diff) |
Add -reindex, to perform in-place reindexing of block chain files
Flushes the blktree/ and coins/ databases, and reindexes the
block chain files, as if their contents was loaded via -loadblock.
Based on earlier work by Jeff Garzik.
Diffstat (limited to 'src/main.h')
-rw-r--r-- | src/main.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main.h b/src/main.h index c2ecefa8f0..25dddae0f8 100644 --- a/src/main.h +++ b/src/main.h @@ -88,6 +88,7 @@ extern CCriticalSection cs_setpwalletRegistered; extern std::set<CWallet*> setpwalletRegistered; extern unsigned char pchMessageStart[4]; extern bool fImporting; +extern bool fReindex; extern unsigned int nCoinCacheSize; // Settings @@ -109,12 +110,12 @@ class CCoinsViewCache; void RegisterWallet(CWallet* pwalletIn); void UnregisterWallet(CWallet* pwalletIn); void SyncWithWallets(const uint256 &hash, const CTransaction& tx, const CBlock* pblock = NULL, bool fUpdate = false); -bool ProcessBlock(CNode* pfrom, CBlock* pblock); +bool ProcessBlock(CNode* pfrom, CBlock* pblock, CDiskBlockPos *dbp = NULL); bool CheckDiskSpace(uint64 nAdditionalBytes=0); FILE* OpenBlockFile(const CDiskBlockPos &pos, bool fReadOnly = false); FILE* OpenUndoFile(const CDiskBlockPos &pos, bool fReadOnly = false); -bool LoadExternalBlockFile(FILE* fileIn); -bool LoadBlockIndex(bool fAllowNew=true); +bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp = NULL); +bool LoadBlockIndex(); void PrintBlockTree(); CBlockIndex* FindBlockByHeight(int nHeight); bool ProcessMessages(CNode* pfrom); @@ -1262,7 +1263,8 @@ public: bool CheckBlock(bool fCheckPOW=true, bool fCheckMerkleRoot=true) const; // Store block on disk - bool AcceptBlock(); + // if dbp is provided, the file is known to already reside on disk + bool AcceptBlock(CDiskBlockPos *dbp = NULL); }; |