File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -536,17 +536,14 @@ void GovernanceList::voteForProposal(vote_outcome_enum_t outcome)
536536
537537 const uint256 proposalHash (uint256S (proposal->hash ().toStdString ()));
538538
539- // Check if wallet is locked and unlock if needed
540- WalletModel::EncryptionStatus encStatus = walletModel->getEncryptionStatus ();
541- if (encStatus == WalletModel::Locked || encStatus == WalletModel::UnlockedForMixingOnly) {
542- WalletModel::UnlockContext ctx (walletModel->requestUnlock ());
543- if (!ctx.isValid ()) {
544- // Unlock cancelled
545- return ;
546- }
547- // Recursively call the function now that wallet is unlocked
548- return voteForProposal (outcome);
549- } // UnlockContext goes out of scope here, but we've already made the recursive call
539+ // Request unlock if needed and keep context alive for the voting operation
540+ WalletModel::UnlockContext ctx (walletModel->requestUnlock ());
541+ if (!ctx.isValid ()) {
542+ // Unlock cancelled or failed
543+ QMessageBox::warning (this , tr (" Voting Failed" ),
544+ tr (" Unable to unlock wallet." ));
545+ return ;
546+ }
550547
551548 int nSuccessful = 0 ;
552549 int nFailed = 0 ;
You can’t perform that action at this time.
0 commit comments