MCPcopy Create free account
hub / github.com/ElementsProject/elements / openWithPSBT

Method openWithPSBT

src/qt/psbtoperationsdialog.cpp:52–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52void 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
76void PSBTOperationsDialog::signTransaction()
77{

Callers 1

gotoLoadPSBTMethod · 0.80

Calls 6

FinalizePSBTFunction · 0.85
TransactionErrorStringFunction · 0.85
fillPSBTMethod · 0.80
privateKeysDisabledMethod · 0.80
walletMethod · 0.45
setEnabledMethod · 0.45

Tested by

no test coverage detected