mirror of
https://github.com/wownero/wowlet.git
synced 2026-11-15 20:53:56 +01:00
Allow resending failed transactions
This commit is contained in:
+15
-4
@@ -289,11 +289,8 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent) :
|
||||
});
|
||||
|
||||
// History
|
||||
connect(ui->historyWidget, &HistoryWidget::spendProof, [&](const QString &txid){
|
||||
TxProof txproof = m_ctx->currentWallet->getSpendProof(txid, "");
|
||||
Utils::copyToClipboard(txproof.proof);
|
||||
});
|
||||
connect(ui->historyWidget, &HistoryWidget::viewOnBlockExplorer, this, &MainWindow::onViewOnBlockExplorer);
|
||||
connect(ui->historyWidget, &HistoryWidget::resendTransaction, this, &MainWindow::onResendTransaction);
|
||||
|
||||
// Contacts
|
||||
connect(ui->contactWidget, &ContactsWidget::addContact, this, &MainWindow::onAddContact);
|
||||
@@ -1055,6 +1052,20 @@ void MainWindow::onViewOnBlockExplorer(const QString &txid) {
|
||||
Utils::externalLinkWarning(this, blockExplorerLink);
|
||||
}
|
||||
|
||||
void MainWindow::onResendTransaction(const QString &txid) {
|
||||
if (!AppContext::txCache.contains(txid)) {
|
||||
QMessageBox::warning(this, "Unable to resend transaction", "Transaction was not found in transaction cache. Unable to resend.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Connect to a different node so chances of successful relay are higher
|
||||
m_ctx->nodes->autoConnect(true);
|
||||
|
||||
auto dialog = new BroadcastTxDialog(this, m_ctx, AppContext::txCache[txid]);
|
||||
dialog->exec();
|
||||
dialog->deleteLater();
|
||||
}
|
||||
|
||||
void MainWindow::onAddContact(const QString &address, const QString &name) {
|
||||
bool addressValid = WalletManager::addressValid(address, m_ctx->currentWallet->nettype());
|
||||
if (!addressValid)
|
||||
|
||||
Reference in New Issue
Block a user