Browse Source

Set nChainPayments and increasing debugging/logging

pull/58/head
Duke Leto 5 years ago
parent
commit
97df4d43ec
  1. 11
      src/init.cpp
  2. 5
      src/main.cpp

11
src/init.cpp

@ -1755,11 +1755,14 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
boost::filesystem::remove(GetDataDir() / "komodostate");
boost::filesystem::remove(GetDataDir() / "signedmasks");
pblocktree->WriteReindexing(true);
fprintf(stderr, "%s: Deleted komodostate and signedmasks...\n", __FUNCTION__);
//If we're reindexing in prune mode, wipe away unusable block files and all undo data files
if (fPruneMode)
CleanupBlockRevFiles();
}
fprintf(stderr, "%s: Loading block index...\n", __FUNCTION__);
if (!LoadBlockIndex()) {
strLoadError = _("Error loading block database");
break;
@ -1819,14 +1822,14 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
}
if ( KOMODO_REWIND == 0 )
{
if (!CVerifyDB().VerifyDB(pcoinsdbview, GetArg("-checklevel", 3),
GetArg("-checkblocks", 288))) {
LogPrintf("Verifying block DB...");
if (!CVerifyDB().VerifyDB(pcoinsdbview, GetArg("-checklevel", 3), GetArg("-checkblocks", 288))) {
strLoadError = _("Corrupted block database detected");
break;
}
}
} catch (const std::exception& e) {
if (fDebug) LogPrintf("%s\n", e.what());
LogPrintf("%s: Error opening block database: %s\n", __FUNCTION__, e.what());
strLoadError = _("Error opening block database");
break;
}
@ -1837,7 +1840,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
if (!fLoaded) {
// first suggest a reindex
if (!fReset) {
fprintf(stderr,"%s error in hd data\n", __FUNCTION__);
fprintf(stderr,"%s: error in hd data\n", __FUNCTION__);
bool fRet = uiInterface.ThreadSafeMessageBox(
strLoadError + ".\n\n" + _("error in HDD data, might just need to update to latest, if that doesnt work, then you need to resync"),
"", CClientUIInterface::MSG_ERROR | CClientUIInterface::BTN_ABORT);

5
src/main.cpp

@ -6140,6 +6140,7 @@ bool static LoadBlockIndexDB()
pindex->nChainShieldedPayments = pindex->pprev->nChainShieldedPayments + pindex->nShieldedPayments;
pindex->nChainShieldingTx = pindex->pprev->nChainShieldingTx + pindex->nShieldingTx;
pindex->nChainPayments = pindex->pprev->nChainPayments + pindex->nPayments;
pindex->nChainShieldingPayments = pindex->pprev->nChainShieldingPayments + pindex->nShieldingPayments;
pindex->nChainDeshieldingTx = pindex->pprev->nChainShieldedTx + pindex->nShieldedTx;
pindex->nChainDeshieldingPayments = pindex->pprev->nChainShieldedPayments + pindex->nShieldedPayments;
@ -6160,6 +6161,7 @@ bool static LoadBlockIndexDB()
} else {
pindex->nChainTx = 0;
if (fZindex) {
pindex->nChainPayments = 0;
pindex->nChainNotarizations = 0;
pindex->nChainShieldedTx = 0;
pindex->nChainFullyShieldedTx = 0;
@ -6179,6 +6181,7 @@ bool static LoadBlockIndexDB()
pindex->nChainSproutValue = pindex->nSproutValue;
pindex->nChainSaplingValue = pindex->nSaplingValue;
if (fZindex) {
pindex->nChainPayments = pindex->nPayments;
pindex->nChainNotarizations = pindex->nNotarizations;
pindex->nChainShieldedTx = pindex->nShieldedTx;
pindex->nChainShieldedPayments = pindex->nShieldedPayments;
@ -6243,7 +6246,7 @@ bool static LoadBlockIndexDB()
setBlkDataFiles.insert(pindex->nFile);
}
}
//fprintf(stderr,"load blockindexDB %u\n",(uint32_t)time(NULL));
fprintf(stderr,"load blockindexDB %u\n",(uint32_t)time(NULL));
for (std::set<int>::iterator it = setBlkDataFiles.begin(); it != setBlkDataFiles.end(); it++)
{
CDiskBlockPos pos(*it, 0);

Loading…
Cancel
Save