aboutsummaryrefslogtreecommitdiff
path: root/src/qt/psbtoperationsdialog.cpp
diff options
context:
space:
mode:
authorSamuel Dobson <dobsonsa68@gmail.com>2021-09-28 12:49:14 +1300
committerSamuel Dobson <dobsonsa68@gmail.com>2021-09-28 13:27:07 +1300
commit7e3ee4cdd0f60a2f549ba030fe96b90d61c036c5 (patch)
treeeb1b066d6b4cdfc291c7149082be4f01249946f9 /src/qt/psbtoperationsdialog.cpp
parent0f3acecf3372f9da143590bb17d8444564e083f4 (diff)
downloadbitcoin-7e3ee4cdd0f60a2f549ba030fe96b90d61c036c5.tar.xz
GUI: Ask user to unlock wallet before signing psbt
Diffstat (limited to 'src/qt/psbtoperationsdialog.cpp')
-rw-r--r--src/qt/psbtoperationsdialog.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/qt/psbtoperationsdialog.cpp b/src/qt/psbtoperationsdialog.cpp
index 289fb9f7c8..34d56e5506 100644
--- a/src/qt/psbtoperationsdialog.cpp
+++ b/src/qt/psbtoperationsdialog.cpp
@@ -71,6 +71,9 @@ void PSBTOperationsDialog::signTransaction()
{
bool complete;
size_t n_signed;
+
+ WalletModel::UnlockContext ctx(m_wallet_model->requestUnlock());
+
TransactionError err = m_wallet_model->wallet().fillPSBT(SIGHASH_ALL, true /* sign */, true /* bip32derivs */, &n_signed, m_transaction_data, complete);
if (err != TransactionError::OK) {
@@ -81,7 +84,9 @@ void PSBTOperationsDialog::signTransaction()
updateTransactionDisplay();
- if (!complete && n_signed < 1) {
+ if (!complete && !ctx.isValid()) {
+ showStatus(tr("Cannot sign inputs while wallet is locked."), StatusLevel::WARN);
+ } else if (!complete && n_signed < 1) {
showStatus(tr("Could not sign any more inputs."), StatusLevel::WARN);
} else if (!complete) {
showStatus(tr("Signed %1 inputs, but more signatures are still required.").arg(n_signed),