console and mining tab visual improvements
This commit is contained in:
@@ -212,11 +212,14 @@ void App::unlockWallet(const std::string& passphrase, int timeout) {
|
||||
if (!rpc_ || !rpc_->isConnected() || !worker_) return;
|
||||
lock_unlock_in_progress_ = true;
|
||||
|
||||
worker_->post([this, passphrase, timeout]() -> rpc::RPCWorker::MainCb {
|
||||
// Use fast-lane worker to bypass head-of-line blocking behind refreshData.
|
||||
auto* w = (fast_worker_ && fast_worker_->isRunning()) ? fast_worker_.get() : worker_.get();
|
||||
auto* r = (fast_rpc_ && fast_rpc_->isConnected()) ? fast_rpc_.get() : rpc_.get();
|
||||
w->post([this, r, passphrase, timeout]() -> rpc::RPCWorker::MainCb {
|
||||
bool ok = false;
|
||||
std::string err_msg;
|
||||
try {
|
||||
rpc_->call("walletpassphrase", {passphrase, timeout});
|
||||
r->call("walletpassphrase", {passphrase, timeout});
|
||||
ok = true;
|
||||
} catch (const std::exception& e) {
|
||||
err_msg = e.what();
|
||||
@@ -256,10 +259,13 @@ void App::lockWallet() {
|
||||
if (lock_unlock_in_progress_) return; // Prevent duplicate async calls
|
||||
lock_unlock_in_progress_ = true;
|
||||
|
||||
worker_->post([this]() -> rpc::RPCWorker::MainCb {
|
||||
// Use fast-lane worker to avoid blocking behind refreshData.
|
||||
auto* w = (fast_worker_ && fast_worker_->isRunning()) ? fast_worker_.get() : worker_.get();
|
||||
auto* r = (fast_rpc_ && fast_rpc_->isConnected()) ? fast_rpc_.get() : rpc_.get();
|
||||
w->post([this, r]() -> rpc::RPCWorker::MainCb {
|
||||
bool ok = false;
|
||||
try {
|
||||
rpc_->call("walletlock");
|
||||
r->call("walletlock");
|
||||
ok = true;
|
||||
} catch (...) {}
|
||||
|
||||
@@ -279,11 +285,13 @@ void App::changePassphrase(const std::string& oldPass, const std::string& newPas
|
||||
encrypt_in_progress_ = true;
|
||||
encrypt_status_ = "Changing passphrase...";
|
||||
|
||||
worker_->post([this, oldPass, newPass]() -> rpc::RPCWorker::MainCb {
|
||||
auto* w = (fast_worker_ && fast_worker_->isRunning()) ? fast_worker_.get() : worker_.get();
|
||||
auto* r = (fast_rpc_ && fast_rpc_->isConnected()) ? fast_rpc_.get() : rpc_.get();
|
||||
w->post([this, r, oldPass, newPass]() -> rpc::RPCWorker::MainCb {
|
||||
bool ok = false;
|
||||
std::string err_msg;
|
||||
try {
|
||||
rpc_->call("walletpassphrasechange", {oldPass, newPass});
|
||||
r->call("walletpassphrasechange", {oldPass, newPass});
|
||||
ok = true;
|
||||
} catch (const std::exception& e) {
|
||||
err_msg = e.what();
|
||||
@@ -609,8 +617,11 @@ void App::renderLockScreen() {
|
||||
memset(lock_pin_buf_, 0, sizeof(lock_pin_buf_));
|
||||
lock_unlock_in_progress_ = true;
|
||||
|
||||
if (worker_) {
|
||||
worker_->post([this, pin, timeout]() -> rpc::RPCWorker::MainCb {
|
||||
// Use fast-lane worker for priority unlock.
|
||||
auto* w = (fast_worker_ && fast_worker_->isRunning()) ? fast_worker_.get() : worker_.get();
|
||||
auto* r = (fast_rpc_ && fast_rpc_->isConnected()) ? fast_rpc_.get() : rpc_.get();
|
||||
if (w) {
|
||||
w->post([this, r, pin, timeout]() -> rpc::RPCWorker::MainCb {
|
||||
// Heavy Argon2id derivation runs here (worker thread)
|
||||
std::string passphrase;
|
||||
bool vaultOk = vault_ && vault_->retrieve(pin, passphrase);
|
||||
@@ -634,8 +645,8 @@ void App::renderLockScreen() {
|
||||
bool rpcOk = false;
|
||||
std::string rpcErr;
|
||||
try {
|
||||
if (rpc_ && rpc_->isConnected()) {
|
||||
rpc_->call("walletpassphrase", {passphrase, timeout});
|
||||
if (r && r->isConnected()) {
|
||||
r->call("walletpassphrase", {passphrase, timeout});
|
||||
rpcOk = true;
|
||||
} else {
|
||||
rpcErr = "Not connected to daemon";
|
||||
|
||||
Reference in New Issue
Block a user