diff --git a/nano/node/wallet.cpp b/nano/node/wallet.cpp index ec128f296..f2e05c6cd 100644 --- a/nano/node/wallet.cpp +++ b/nano/node/wallet.cpp @@ -699,8 +699,9 @@ bool nano::wallet::enter_password (store::transaction const & transaction_a, std auto result (store.attempt_password (transaction_a, password_a)); if (!result) { - auto this_l (shared_from_this ()); - wallets.node.background ([this_l] () { + auto this_l = shared_from_this (); + wallets.node.wallets.queue_wallet_action (nano::wallets::high_priority, this_l, [this_l] (nano::wallet & wallet) { + // Wallets must survive node lifetime this_l->search_receivable (this_l->wallets.tx_begin_read ()); }); wallets.node.logger.try_log ("Wallet unlocked"); diff --git a/nano/qt_test/qt.cpp b/nano/qt_test/qt.cpp index 8e3dea40b..f7b1b41ae 100644 --- a/nano/qt_test/qt.cpp +++ b/nano/qt_test/qt.cpp @@ -285,8 +285,11 @@ TEST (wallet, enter_password) wallet->settings.new_password->setText (""); QTest::keyClicks (wallet->settings.password, "abc"); QTest::mouseClick (wallet->settings.lock_toggle, Qt::LeftButton); - test_application->processEvents (); - ASSERT_NE (wallet->status->text ().toStdString ().rfind ("Status: Running", 0), std::string::npos); + auto is_running_status = [&wallet] () -> bool { + test_application->processEvents (); + return wallet->status->text ().toStdString ().rfind ("Status: Running", 0) != std::string::npos; + }; + ASSERT_TIMELY (5s, is_running_status ()); ASSERT_EQ ("", wallet->settings.password->text ()); }