Merge pull request #228 from UdjinM6/v0.11.2.x_masternodes.dat_rename
V0.11.2.x rename masternodes.dat
This commit is contained in:
commit
953e978424
@ -1152,14 +1152,14 @@ bool AppInit2(boost::thread_group& threadGroup)
|
|||||||
//CAddress addr;
|
//CAddress addr;
|
||||||
//ConnectNode(addr, strNode.c_str(), true);
|
//ConnectNode(addr, strNode.c_str(), true);
|
||||||
|
|
||||||
uiInterface.InitMessage(_("Loading masternode list..."));
|
uiInterface.InitMessage(_("Loading masternode cache..."));
|
||||||
|
|
||||||
CMasternodeDB mndb;
|
CMasternodeDB mndb;
|
||||||
CMasternodeDB::ReadResult readResult = mndb.Read(mnodeman);
|
CMasternodeDB::ReadResult readResult = mndb.Read(mnodeman);
|
||||||
if (readResult == CMasternodeDB::FileError)
|
if (readResult == CMasternodeDB::FileError)
|
||||||
LogPrintf("Missing masternode list file - masternodes.dat, will try to recreate\n");
|
LogPrintf("Missing masternode cache file - mncache.dat, will try to recreate\n");
|
||||||
else if (readResult != CMasternodeDB::Ok)
|
else if (readResult != CMasternodeDB::Ok)
|
||||||
LogPrintf("Masternode list file masternodes.dat has invalid format\n");
|
LogPrintf("Masternode cache file mncache.dat has invalid format\n");
|
||||||
|
|
||||||
fMasterNode = GetBoolArg("-masternode", false);
|
fMasterNode = GetBoolArg("-masternode", false);
|
||||||
if(fMasterNode) {
|
if(fMasterNode) {
|
||||||
|
@ -30,7 +30,7 @@ struct CompareValueOnly
|
|||||||
|
|
||||||
CMasternodeDB::CMasternodeDB()
|
CMasternodeDB::CMasternodeDB()
|
||||||
{
|
{
|
||||||
pathMN = GetDataDir() / "masternodes.dat";
|
pathMN = GetDataDir() / "mncache.dat";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CMasternodeDB::Write(const CMasternodeMan& mnodemanToSave)
|
bool CMasternodeDB::Write(const CMasternodeMan& mnodemanToSave)
|
||||||
@ -60,7 +60,7 @@ bool CMasternodeDB::Write(const CMasternodeMan& mnodemanToSave)
|
|||||||
FileCommit(fileout);
|
FileCommit(fileout);
|
||||||
fileout.fclose();
|
fileout.fclose();
|
||||||
|
|
||||||
LogPrintf("Written info to masternodes.dat %dms\n", GetTimeMillis() - nStart);
|
LogPrintf("Written info to mncache.dat %dms\n", GetTimeMillis() - nStart);
|
||||||
LogPrintf(" %s\n", mnodemanToSave.ToString());
|
LogPrintf(" %s\n", mnodemanToSave.ToString());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -131,7 +131,7 @@ CMasternodeDB::ReadResult CMasternodeDB::Read(CMasternodeMan& mnodemanToLoad)
|
|||||||
}
|
}
|
||||||
|
|
||||||
mnodemanToLoad.CheckAndRemove(); // clean out expired
|
mnodemanToLoad.CheckAndRemove(); // clean out expired
|
||||||
LogPrintf("Loaded info from masternodes.dat %dms\n", GetTimeMillis() - nStart);
|
LogPrintf("Loaded info from mncache.dat %dms\n", GetTimeMillis() - nStart);
|
||||||
LogPrintf(" %s\n", mnodemanToLoad.ToString());
|
LogPrintf(" %s\n", mnodemanToLoad.ToString());
|
||||||
|
|
||||||
return Ok;
|
return Ok;
|
||||||
@ -144,17 +144,17 @@ void DumpMasternodes()
|
|||||||
CMasternodeDB mndb;
|
CMasternodeDB mndb;
|
||||||
CMasternodeMan tempMnodeman;
|
CMasternodeMan tempMnodeman;
|
||||||
|
|
||||||
LogPrintf("Verifying masternodes.dat format...\n");
|
LogPrintf("Verifying mncache.dat format...\n");
|
||||||
CMasternodeDB::ReadResult readResult = mndb.Read(tempMnodeman);
|
CMasternodeDB::ReadResult readResult = mndb.Read(tempMnodeman);
|
||||||
// there was an error and it was not an error on file openning => do not proceed
|
// there was an error and it was not an error on file openning => do not proceed
|
||||||
if (readResult == CMasternodeDB::FileError)
|
if (readResult == CMasternodeDB::FileError)
|
||||||
LogPrintf("Missing masternode list file - masternodes.dat, will try to recreate\n");
|
LogPrintf("Missing masternode cache file - mncache.dat, will try to recreate\n");
|
||||||
else if (readResult != CMasternodeDB::Ok)
|
else if (readResult != CMasternodeDB::Ok)
|
||||||
{
|
{
|
||||||
LogPrintf("Masternode list file masternodes.dat has invalid format\n");
|
LogPrintf("Masternode cache file mncache.dat has invalid format\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LogPrintf("Writting info to masternodes.dat...\n");
|
LogPrintf("Writting info to mncache.dat...\n");
|
||||||
mndb.Write(mnodeman);
|
mndb.Write(mnodeman);
|
||||||
|
|
||||||
LogPrintf("Masternode dump finished %dms\n", GetTimeMillis() - nStart);
|
LogPrintf("Masternode dump finished %dms\n", GetTimeMillis() - nStart);
|
||||||
|
@ -26,7 +26,7 @@ class CMasternodeMan;
|
|||||||
extern CMasternodeMan mnodeman;
|
extern CMasternodeMan mnodeman;
|
||||||
void DumpMasternodes();
|
void DumpMasternodes();
|
||||||
|
|
||||||
/** Access to the MN database (masternodes.dat)
|
/** Access to the MN database (mncache.dat)
|
||||||
*/
|
*/
|
||||||
class CMasternodeDB
|
class CMasternodeDB
|
||||||
{
|
{
|
||||||
|
@ -276,7 +276,7 @@ QT_TRANSLATE_NOOP("darkcoin-core", "List commands"),
|
|||||||
QT_TRANSLATE_NOOP("darkcoin-core", "Listen for connections on <port> (default: 9999 or testnet: 19999)"),
|
QT_TRANSLATE_NOOP("darkcoin-core", "Listen for connections on <port> (default: 9999 or testnet: 19999)"),
|
||||||
QT_TRANSLATE_NOOP("darkcoin-core", "Loading addresses..."),
|
QT_TRANSLATE_NOOP("darkcoin-core", "Loading addresses..."),
|
||||||
QT_TRANSLATE_NOOP("darkcoin-core", "Loading block index..."),
|
QT_TRANSLATE_NOOP("darkcoin-core", "Loading block index..."),
|
||||||
QT_TRANSLATE_NOOP("darkcoin-core", "Loading masternode list..."),
|
QT_TRANSLATE_NOOP("darkcoin-core", "Loading masternode cache..."),
|
||||||
QT_TRANSLATE_NOOP("darkcoin-core", "Loading wallet... (%3.2f %%)"),
|
QT_TRANSLATE_NOOP("darkcoin-core", "Loading wallet... (%3.2f %%)"),
|
||||||
QT_TRANSLATE_NOOP("darkcoin-core", "Loading wallet..."),
|
QT_TRANSLATE_NOOP("darkcoin-core", "Loading wallet..."),
|
||||||
QT_TRANSLATE_NOOP("darkcoin-core", "Log transaction priority and fee per kB when mining blocks (default: 0)"),
|
QT_TRANSLATE_NOOP("darkcoin-core", "Log transaction priority and fee per kB when mining blocks (default: 0)"),
|
||||||
|
Loading…
Reference in New Issue
Block a user