aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 010db0c1e..302292ee2 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1992,11 +1992,17 @@ bool CheckDiskSpace(uint64 nAdditionalBytes)
return true;
}
+static filesystem::path BlockFilePath(unsigned int nFile)
+{
+ string strBlockFn = strprintf("blk%04u.dat", nFile);
+ return GetDataDir() / strBlockFn;
+}
+
FILE* OpenBlockFile(unsigned int nFile, unsigned int nBlockPos, const char* pszMode)
{
if ((nFile < 1) || (nFile == (unsigned int) -1))
return NULL;
- FILE* file = fopen((GetDataDir() / strprintf("blk%04d.dat", nFile)).string().c_str(), pszMode);
+ FILE* file = fopen(BlockFilePath(nFile).string().c_str(), pszMode);
if (!file)
return NULL;
if (nBlockPos != 0 && !strchr(pszMode, 'a') && !strchr(pszMode, 'w'))
@@ -2595,7 +2601,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
// In case we are on a very long side-chain, it is possible that we already have
// the last block in an inv bundle sent in response to getblocks. Try to detect
// this situation and push another getblocks to continue.
- std::vector<CInv> vGetData(1,inv);
pfrom->PushGetBlocks(mapBlockIndex[inv.hash], uint256(0));
if (fDebug)
printf("force request: %s\n", inv.ToString().c_str());
@@ -3941,8 +3946,8 @@ void GenerateBitcoins(bool fGenerate, CWallet* pwallet)
printf("Starting %d BitcoinMiner threads\n", nAddThreads);
for (int i = 0; i < nAddThreads; i++)
{
- if (!CreateThread(ThreadBitcoinMiner, pwallet))
- printf("Error: CreateThread(ThreadBitcoinMiner) failed\n");
+ if (!NewThread(ThreadBitcoinMiner, pwallet))
+ printf("Error: NewThread(ThreadBitcoinMiner) failed\n");
Sleep(10);
}
}