Check for invalid private keys in wallet_decrypt_unsafe (#1128)

This commit is contained in:
SergiySW 2018-09-11 19:59:12 +03:00 committed by Roy Keene
commit f94707eb8c

View file

@ -453,6 +453,10 @@ std::error_code rai::handle_node_options (boost::program_options::variables_map
auto error (existing->second->store.fetch (transaction, account, key));
assert (!error);
std::cout << boost::str (boost::format ("Pub: %1% Prv: %2%\n") % account.to_account () % key.data.to_string ());
if (rai::pub_key (key.data) != account)
{
std::cerr << boost::str (boost::format ("Invalid private key %1%\n") % key.data.to_string ());
}
}
}
else