Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ GRIDCOIN_CORE_H = \
neuralnet/accrual/newbie.h \
neuralnet/accrual/null.h \
neuralnet/accrual/research_age.h \
neuralnet/accrual/snapshot.h \
neuralnet/claim.h \
neuralnet/cpid.h \
neuralnet/magnitude.h \
Expand Down
2 changes: 0 additions & 2 deletions src/global_objects_noui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#include <map>
#include <set>

extern int nBoincUtilization;
extern std::string sRegVer;
extern bool bForceUpdate;
extern bool fQtActive;
extern bool bGridcoinCoreInitComplete;
Expand Down
31 changes: 23 additions & 8 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.


#include "block.h"
#include "util.h"
#include "net.h"
#include "txdb.h"
Expand Down Expand Up @@ -156,7 +157,7 @@ static BOOL WINAPI consoleCtrlHandler(DWORD dwCtrlType)
Sleep(INFINITE);
return true;
}
#endif
#endif


#ifndef WIN32
Expand Down Expand Up @@ -322,7 +323,7 @@ bool InitSanityCheck(void)
"information, visit https://en.bitcoin.it/wiki/OpenSSL_and_EC_Libraries");
return false;
}

return true;
}

Expand Down Expand Up @@ -384,6 +385,10 @@ void InitLogging()
}
}

// TODO: enable tally and accrual debug log categories during Fern testing:
LogInstance().EnableCategory("tally");
LogInstance().EnableCategory("accrual");

std::vector<std::string> excluded_categories;

if (mapArgs.count("-debugexclude") && mapMultiArgs["-debugexclude"].size() > 0)
Expand Down Expand Up @@ -694,7 +699,7 @@ bool AppInit2(ThreadHandlerPtr threads)

// Initialize internal hashing code with SSE/AVX2 optimizations. In the future we will also have ARM/NEON optimizations.
std::string sha256_algo = SHA256AutoDetect();
LogPrintf("Using the '%s' SHA256 implementation\n", sha256_algo);
LogPrintf("Using the '%s' SHA256 implementation\n", sha256_algo);

fs::path datadir = GetDataDir();
fs::path walletFileName = GetArg("-wallet", "wallet.dat");
Expand All @@ -712,7 +717,7 @@ bool AppInit2(ThreadHandlerPtr threads)
}


#if !defined(WIN32)
#if !defined(WIN32)
if (fDaemon)
{
// Daemonize
Expand Down Expand Up @@ -943,6 +948,15 @@ bool AppInit2(ThreadHandlerPtr threads)
NN::Quorum::LoadSuperblockIndex(pindexBest);
}

// Initialize the Gridcoin research reward tally system from the first
// research age block (as defined in main.h):
//
uiInterface.InitMessage(_("Initializing research reward tally..."));
if (!NN::Tally::Initialize(BlockFinder().FindByHeight(GetResearchAgeThreshold())))
{
return InitError(_("Failed to initialize tally."));
}

if (GetBoolArg("-printblockindex") || GetBoolArg("-printblocktree"))
{
PrintBlockTree();
Expand Down Expand Up @@ -1148,11 +1162,12 @@ bool AppInit2(ThreadHandlerPtr threads)
LogPrintf("mapAddressBook.size() = %" PRIszu, pwalletMain->mapAddressBook.size());
}

if (pindexBest->nVersion <= 10) {
uiInterface.InitMessage(_("Loading Network Averages..."));
if (fDebug3) LogPrintf("Loading network averages");

uiInterface.InitMessage(_("Loading Network Averages..."));
if (fDebug3) LogPrintf("Loading network averages");

NN::Tally::LegacyRecount(NN::Tally::FindTrigger(pindexBest));
NN::Tally::LegacyRecount(NN::Tally::FindLegacyTrigger(pindexBest));
}

if (!threads->createThread(StartNode, NULL, "Start Thread"))
InitError(_("Error: could not start node"));
Expand Down
2 changes: 2 additions & 0 deletions src/logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ const CLogCategoryDesc LogCategories[] =
{BCLog::MANIFEST, "manifest"},
{BCLog::SB, "superblock"},
{BCLog::ALERT, "alert"},
{BCLog::TALLY, "tally"},
{BCLog::ACCRUAL, "accrual"},
{BCLog::ALL, "1"},
{BCLog::ALL, "all"},
};
Expand Down
2 changes: 2 additions & 0 deletions src/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ namespace BCLog {
MANIFEST = (1 << 22),
SB = (1 << 23),
ALERT = (1 << 24),
TALLY = (1 << 25),
ACCRUAL = (1 << 26),
ALL = ~(uint32_t)0,
};

Expand Down
Loading