Replacing static network_params with a default inactive node.

This commit is contained in:
clemahieu 2021-08-04 00:46:02 +01:00
commit 624674a237
No known key found for this signature in database
GPG key ID: 43708520C8DFB938

View file

@ -440,14 +440,14 @@ int main (int argc, char * const * argv)
}
else if (vm.count ("debug_profile_kdf"))
{
nano::network_params network_params;
auto inactive_node = nano::default_inactive_node (data_path, vm);
nano::uint256_union result;
nano::uint256_union salt (0);
std::string password ("");
while (true)
{
auto begin1 (std::chrono::high_resolution_clock::now ());
auto success (argon2_hash (1, network_params.kdf_work, 1, password.data (), password.size (), salt.bytes.data (), salt.bytes.size (), result.bytes.data (), result.bytes.size (), NULL, 0, Argon2_d, 0x10));
auto success (argon2_hash (1, inactive_node->node->network_params.kdf_work, 1, password.data (), password.size (), salt.bytes.data (), salt.bytes.size (), result.bytes.data (), result.bytes.size (), NULL, 0, Argon2_d, 0x10));
(void)success;
auto end1 (std::chrono::high_resolution_clock::now ());
std::cerr << boost::str (boost::format ("Derivation time: %1%us\n") % std::chrono::duration_cast<std::chrono::microseconds> (end1 - begin1).count ());