aboutsummaryrefslogtreecommitdiff
path: root/src/libwalletqt/Wallet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libwalletqt/Wallet.cpp')
-rw-r--r--src/libwalletqt/Wallet.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp
index 0c320842..17b391a6 100644
--- a/src/libwalletqt/Wallet.cpp
+++ b/src/libwalletqt/Wallet.cpp
@@ -496,6 +496,22 @@ bool Wallet::submitTxFile(const QString &fileName) const
return m_walletImpl->importKeyImages(fileName.toStdString() + "_keyImages");
}
+void Wallet::commitTransactionAsync(PendingTransaction *t)
+{
+ QStringList txid(t->txid());
+ QFuture<bool> future = QtConcurrent::run(t, &PendingTransaction::commit);
+
+ QFutureWatcher<bool> * watcher = new QFutureWatcher<bool>();
+
+ connect(watcher, &QFutureWatcher<bool>::finished,
+ this, [this, watcher, t, txid]() {
+ QFuture<bool> future = watcher->future();
+ watcher->deleteLater();
+ emit transactionCommitted(future.result(), t, txid);
+ });
+ watcher->setFuture(future);
+}
+
void Wallet::disposeTransaction(PendingTransaction *t)
{
m_walletImpl->disposeTransaction(t->m_pimpl);