HomePhabricator

Run background seeding periodically instead of unpredictably

Description

Run background seeding periodically instead of unpredictably

Summary:

* Instead of calling RandAddSeedSleep anytime the scheduler goes
  idle, call its replacement (RandAddSeedPeriodic) just once per
  minute. This has better guarantees of actually being run, and
  helps limit how frequently the dynamic env data is gathered.
* Since this code runs once per minute regardless now, we no
  longer need to keep track of the last time strengthening was
  run; just do it always.
* Make strengthening time context dependent (100 ms at startup,
  10 ms once per minute afterwards).

Partial backport of core PR17270:
https://github.com/bitcoin/bitcoin/pull/17270/commits/d61f2bb076d8f17840a8e79f1583d7f6e3e6d09a

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D6207

Details

Provenance
Pieter Wuille <pieter.wuille@gmail.com>Authored on Oct 29 2019, 18:55
FabienCommitted on May 22 2020, 11:45
FabienPushed on May 22 2020, 11:45
Reviewer
Restricted Project
Differential Revision
D6207: Run background seeding periodically instead of unpredictably
Parents
rABC05debbcdd0a2: Add information gathered through getauxval()
Branches
Unknown
Tags
Unknown