mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-24 16:01:26 +02:00
GUI: Ask user to unlock wallet before signing psbt
This commit is contained in:
parent
0f3acecf33
commit
7e3ee4cdd0
@ -71,6 +71,9 @@ void PSBTOperationsDialog::signTransaction()
|
|||||||
{
|
{
|
||||||
bool complete;
|
bool complete;
|
||||||
size_t n_signed;
|
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);
|
TransactionError err = m_wallet_model->wallet().fillPSBT(SIGHASH_ALL, true /* sign */, true /* bip32derivs */, &n_signed, m_transaction_data, complete);
|
||||||
|
|
||||||
if (err != TransactionError::OK) {
|
if (err != TransactionError::OK) {
|
||||||
@ -81,7 +84,9 @@ void PSBTOperationsDialog::signTransaction()
|
|||||||
|
|
||||||
updateTransactionDisplay();
|
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);
|
showStatus(tr("Could not sign any more inputs."), StatusLevel::WARN);
|
||||||
} else if (!complete) {
|
} else if (!complete) {
|
||||||
showStatus(tr("Signed %1 inputs, but more signatures are still required.").arg(n_signed),
|
showStatus(tr("Signed %1 inputs, but more signatures are still required.").arg(n_signed),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user