| 50 | } |
| 51 | |
| 52 | void PSBTOperationsDialog::openWithPSBT(PartiallySignedTransaction psbtx) |
| 53 | { |
| 54 | m_transaction_data = psbtx; |
| 55 | |
| 56 | bool complete = FinalizePSBT(psbtx); // Make sure all existing signatures are fully combined before checking for completeness. |
| 57 | if (m_wallet_model) { |
| 58 | size_t n_could_sign; |
| 59 | TransactionError err = m_wallet_model->wallet().fillPSBT(SIGHASH_ALL, false /* sign */, true /* bip32derivs */, &n_could_sign, m_transaction_data, complete); |
| 60 | if (err != TransactionError::OK) { |
| 61 | showStatus(tr("Failed to load transaction: %1") |
| 62 | .arg(QString::fromStdString(TransactionErrorString(err).translated)), |
| 63 | StatusLevel::ERR); |
| 64 | return; |
| 65 | } |
| 66 | m_ui->signTransactionButton->setEnabled(!complete && !m_wallet_model->wallet().privateKeysDisabled() && n_could_sign > 0); |
| 67 | } else { |
| 68 | m_ui->signTransactionButton->setEnabled(false); |
| 69 | } |
| 70 | |
| 71 | m_ui->broadcastTransactionButton->setEnabled(complete); |
| 72 | |
| 73 | updateTransactionDisplay(); |
| 74 | } |
| 75 | |
| 76 | void PSBTOperationsDialog::signTransaction() |
| 77 | { |
no test coverage detected