generator: make sure not to return data unseeded
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-01-26 22:59:37 +01:00
parent 8f0f29d190
commit a1beb2893d
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

View File

@ -138,6 +138,9 @@ auto Generator::generate_blocks(unsigned int k_blocks) -> std::string {
std::lock_guard<std::recursive_mutex> lg(mtx);
assert((G.ctr != 0) && "Counter is not 0, generator has been seeded");
if (!this->is_seeded()) {
throw std::logic_error("G.ctr == 0, generator has not been seeded!");
}
std::string r{""};
while (k_blocks--) {