Skip to content

Commit 7e3ee4c

Browse files
committed
GUI: Ask user to unlock wallet before signing psbt
1 parent 0f3acec commit 7e3ee4c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/qt/psbtoperationsdialog.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ void PSBTOperationsDialog::signTransaction()
7171
{
7272
bool complete;
7373
size_t n_signed;
74+
75+
WalletModel::UnlockContext ctx(m_wallet_model->requestUnlock());
76+
7477
TransactionError err = m_wallet_model->wallet().fillPSBT(SIGHASH_ALL, true /* sign */, true /* bip32derivs */, &n_signed, m_transaction_data, complete);
7578

7679
if (err != TransactionError::OK) {
@@ -81,7 +84,9 @@ void PSBTOperationsDialog::signTransaction()
8184

8285
updateTransactionDisplay();
8386

84-
if (!complete && n_signed < 1) {
87+
if (!complete && !ctx.isValid()) {
88+
showStatus(tr("Cannot sign inputs while wallet is locked."), StatusLevel::WARN);
89+
} else if (!complete && n_signed < 1) {
8590
showStatus(tr("Could not sign any more inputs."), StatusLevel::WARN);
8691
} else if (!complete) {
8792
showStatus(tr("Signed %1 inputs, but more signatures are still required.").arg(n_signed),

0 commit comments

Comments
 (0)