| 105 | } |
| 106 | |
| 107 | void PSBTOperationsDialog::broadcastTransaction() |
| 108 | { |
| 109 | CMutableTransaction mtx; |
| 110 | if (!FinalizeAndExtractPSBT(m_transaction_data, mtx)) { |
| 111 | // This is never expected to fail unless we were given a malformed PSBT |
| 112 | // (e.g. with an invalid signature.) |
| 113 | showStatus(tr("Unknown error processing transaction."), StatusLevel::ERR); |
| 114 | return; |
| 115 | } |
| 116 | |
| 117 | CTransactionRef tx = MakeTransactionRef(mtx); |
| 118 | std::string err_string; |
| 119 | TransactionError error = |
| 120 | m_client_model->node().broadcastTransaction(tx, DEFAULT_MAX_RAW_TX_FEE_RATE.GetFeePerK(), err_string); |
| 121 | |
| 122 | if (error == TransactionError::OK) { |
| 123 | showStatus(tr("Transaction broadcast successfully! Transaction ID: %1") |
| 124 | .arg(QString::fromStdString(tx->GetHash().GetHex())), StatusLevel::INFO); |
| 125 | } else { |
| 126 | showStatus(tr("Transaction broadcast failed: %1") |
| 127 | .arg(QString::fromStdString(TransactionErrorString(error).translated)), StatusLevel::ERR); |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | void PSBTOperationsDialog::copyToClipboard() { |
| 132 | CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); |