wallet2: error out when we need a daemon password but have no prompt function

This commit is contained in:
moneromooo-monero 2019-10-11 13:54:31 +00:00
parent 4233d88341
commit 93e74269b3
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3
1 changed files with 5 additions and 0 deletions

View File

@ -385,6 +385,11 @@ std::unique_ptr<tools::wallet2> make_basic(const boost::program_options::variabl
{ {
auto parsed = tools::login::parse( auto parsed = tools::login::parse(
command_line::get_arg(vm, opts.daemon_login), false, [password_prompter](bool verify) { command_line::get_arg(vm, opts.daemon_login), false, [password_prompter](bool verify) {
if (!password_prompter)
{
MERROR("Password needed without prompt function");
return boost::optional<tools::password_container>();
}
return password_prompter("Daemon client password", verify); return password_prompter("Daemon client password", verify);
} }
); );