Skip to content

Commit

Permalink
Allow scraper activebeforesb to be changed from network protocol with…
Browse files Browse the repository at this point in the history
…out restart
  • Loading branch information
jamescowens committed Oct 10, 2021
1 parent fba5ab8 commit 1191a22
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/gridcoin/scraper/scraper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1579,6 +1579,11 @@ void Scraper(bool bSingleShot)
_log(logattribute::INFO, "Scraper", "Sleeping for " + ToString(scraper_sleep() / 1000) +" seconds");

if (!MilliSleep(scraper_sleep())) return;

// To avoid taking a second lock on cs_main here, which happens inside SuperblockAge(), simply add
// scraper_sleep() to sbage, since that much time has gone by.
sbage += scraper_sleep();
nBeforeSBSleep = std::max(86400 - active_before_SB() - sbage, (int64_t) 0);
}
}

Expand Down

0 comments on commit 1191a22

Please sign in to comment.