diff --git a/src/crypto/sha512.h b/src/crypto/sha512.h --- a/src/crypto/sha512.h +++ b/src/crypto/sha512.h @@ -22,6 +22,7 @@ CSHA512 &Write(const uint8_t *data, size_t len); void Finalize(uint8_t hash[OUTPUT_SIZE]); CSHA512 &Reset(); + uint64_t Size() const { return bytes; } }; #endif // BITCOIN_CRYPTO_SHA512_H diff --git a/src/random.cpp b/src/random.cpp --- a/src/random.cpp +++ b/src/random.cpp @@ -576,7 +576,10 @@ SeedTimestamp(hasher); // Dynamic environment data (performance monitoring, ...) + auto old_size = hasher.Size(); RandAddDynamicEnv(hasher); + LogPrintf("Feeding %i bytes of dynamic environment data into RNG\n", + hasher.Size() - old_size); // Strengthen for 10ms SeedStrengthen(hasher, rng, 10000); @@ -590,10 +593,13 @@ SeedSlow(hasher); // Dynamic environment data (performance monitoring, ...) + auto old_size = hasher.Size(); RandAddDynamicEnv(hasher); // Static environment data RandAddStaticEnv(hasher); + LogPrintf("Feeding %i bytes of environment data into RNG\n", + hasher.Size() - old_size); // Strengthen for 100ms SeedStrengthen(hasher, rng, 100000);