fix wallet locking after sending coins

This commit is contained in:
UdjinM6 2014-12-12 21:10:38 +03:00
parent 7a0df8c452
commit 9db0eaa9b3
2 changed files with 20 additions and 5 deletions

View File

@ -202,7 +202,13 @@ void SendCoinsDialog::on_sendButton_clicked()
fNewRecipientAllowed = false;
// request unlock only if was locked or unlocked for mixing:
// this way we let users unlock by walletpassphrase or by menu
// and make many transactions while unlocking through this dialog
// will call relock
WalletModel::EncryptionStatus encStatus = model->getEncryptionStatus();
if(encStatus == model->Locked || encStatus == model->UnlockedForAnonymizationOnly)
{
WalletModel::UnlockContext ctx(model->requestUnlock(true));
if(!ctx.isValid())
{
@ -210,7 +216,15 @@ void SendCoinsDialog::on_sendButton_clicked()
fNewRecipientAllowed = true;
return;
}
send(recipients, strFee, formatted);
return;
}
// already unlocked or not encrypted at all
send(recipients, strFee, formatted);
}
void SendCoinsDialog::send(QList<SendCoinsRecipient> recipients, QString strFee, QStringList formatted)
{
// prepare transaction for getting txFee earlier
WalletModelTransaction currentTransaction(recipients);
WalletModel::SendCoinsReturn prepareStatus;

View File

@ -53,6 +53,7 @@ private:
Ui::SendCoinsDialog *ui;
WalletModel *model;
bool fNewRecipientAllowed;
void send(QList<SendCoinsRecipient> recipients, QString strFee, QStringList formatted);
// Process WalletModel::SendCoinsReturn and generate a pair consisting
// of a message and message flags for use in emit message().