Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix accrual calculation for new, zero-magnitude CPIDs #1636

Merged
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/gridcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ namespace
uint256S("c1aa0511add3bed3f2e366d38b954285a7602cae10a7244e7fe35e4002e90cd5"), //T629408
uint256S("639756cf39bf12a4a0ab4ea5ec10938fd0f463cc7bc1bd2916529a445ceba2ab"), //T680406
uint256S("ba1aae8ea37a9c330b298bd2b569448f0249a685bb0a8e85698fe44d1edca774"), //T1145954 (6-month cutoff)
uint256S("b05e6c04c7b414a29746b2d642fd19f64e9fdb13dcc4873144233a23138bd419"), //T1154377 (zero-mag newbie)
};


Expand Down
8 changes: 4 additions & 4 deletions src/neuralnet/accrual/newbie.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ class NewbieAccrualComputer : public IAccrualComputer

int64_t Accrual(const ResearchAccount& account) const override
{
if (account.m_magnitude <= 0) {
return 0;
}

constexpr int64_t six_months = 86400 * 30 * 6; // seconds

if (AccrualAge(account) >= six_months) {
if (account.m_magnitude <= 0) {
return 0;
}

if (fDebug) {
LogPrintf(
"Accrual: %s Invalid Beacon, Using 0.01 age bootstrap",
Expand Down