MCPcopy Create free account
hub / github.com/ElementsProject/elements / SeedPeriodic

Function SeedPeriodic

src/random.cpp:506–524  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

504}
505
506static void SeedPeriodic(CSHA512& hasher, RNGState& rng) noexcept
507{
508 // Everything that the 'fast' seeder includes
509 SeedFast(hasher);
510
511 // High-precision timestamp
512 SeedTimestamp(hasher);
513
514 // Add the events hasher into the mix
515 rng.SeedEvents(hasher);
516
517 // Dynamic environment data (performance monitoring, ...)
518 auto old_size = hasher.Size();
519 RandAddDynamicEnv(hasher);
520 LogPrint(BCLog::RAND, "Feeding %i bytes of dynamic environment data into RNG\n", hasher.Size() - old_size);
521
522 // Strengthen for 10 ms
523 SeedStrengthen(hasher, rng, 10000);
524}
525
526static void SeedStartup(CSHA512& hasher, RNGState& rng) noexcept
527{

Callers 1

ProcRandFunction · 0.85

Calls 6

SeedFastFunction · 0.85
SeedTimestampFunction · 0.85
RandAddDynamicEnvFunction · 0.85
SeedStrengthenFunction · 0.85
SeedEventsMethod · 0.80
SizeMethod · 0.45

Tested by

no test coverage detected