Skip to content

Commit

Permalink
Move enter_initial_password out of node.background (#1081)
Browse files Browse the repository at this point in the history
  • Loading branch information
SergiySW authored and rkeene committed Aug 22, 2018
1 parent 6756f72 commit 47bf8c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion rai/node/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ std::error_code rai::handle_node_options (boost::program_options::variables_map
rai::keypair key;
std::cout << key.pub.to_string () << std::endl;
auto wallet (node.node->wallets.create (key.pub));
wallet->enter_initial_password ();
}
else if (vm.count ("wallet_decrypt_unsafe"))
{
Expand Down
11 changes: 5 additions & 6 deletions rai/node/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1302,9 +1302,6 @@ thread ([this]() { do_wallet_actions (); })
auto wallet (std::make_shared<rai::wallet> (error, transaction, node_a, text));
if (!error)
{
node_a.background ([wallet]() {
wallet->enter_initial_password ();
});
items[id] = wallet;
}
else
Expand All @@ -1313,6 +1310,10 @@ thread ([this]() { do_wallet_actions (); })
}
}
}
for (auto i (items.begin ()), n (items.end ()); i != n; ++i)
{
i->second->enter_initial_password ();
}
}

rai::wallets::~wallets ()
Expand Down Expand Up @@ -1343,9 +1344,7 @@ std::shared_ptr<rai::wallet> rai::wallets::create (rai::uint256_union const & id
if (!error)
{
items[id_a] = result;
node.background ([result]() {
result->enter_initial_password ();
});
result->enter_initial_password ();
}
return result;
}
Expand Down

0 comments on commit 47bf8c1

Please sign in to comment.