Move external block import to separate thread

This commit is contained in:
Pieter Wuille
2012-09-13 14:33:52 +02:00
parent 485d667748
commit 66b02c93e6
7 changed files with 70 additions and 27 deletions

View File

@@ -68,6 +68,7 @@ extern int64 nTimeBestReceived;
extern CCriticalSection cs_setpwalletRegistered;
extern std::set<CWallet*> setpwalletRegistered;
extern unsigned char pchMessageStart[4];
extern bool fImporting;
// Settings
extern int64 nTransactionFee;
@@ -92,7 +93,7 @@ void PrintBlockTree();
CBlockIndex* FindBlockByHeight(int nHeight);
bool ProcessMessages(CNode* pfrom);
bool SendMessages(CNode* pto, bool fSendTrickle);
bool LoadExternalBlockFile(FILE* fileIn);
void ThreadImport(void *parg);
void GenerateBitcoins(bool fGenerate, CWallet* pwallet);
CBlock* CreateNewBlock(CReserveKey& reservekey);
void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce);