diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2019-05-10 13:01:29 -0500 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2019-05-10 13:01:29 -0500 |
| commit | abf823e38db11f75f5a1d6b0b0e0104300a59436 (patch) | |
| tree | 50bcbac637e36eff0ee7b6b2f1101730d3786a25 /src/libwalletqt/Wallet.cpp | |
| parent | 08caf05eb2bdc3c3c85188fd914713c6ff284914 (diff) | |
| parent | c88bb60135226dc889e51ad5a494d4bd600662b6 (diff) | |
| download | monzero-gui-abf823e38db11f75f5a1d6b0b0e0104300a59436.tar.gz monzero-gui-abf823e38db11f75f5a1d6b0b0e0104300a59436.tar.xz monzero-gui-abf823e38db11f75f5a1d6b0b0e0104300a59436.zip | |
Merge pull request #2147
c88bb60 transaction: async commit (ph4r05)
Diffstat (limited to 'src/libwalletqt/Wallet.cpp')
| -rw-r--r-- | src/libwalletqt/Wallet.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp index 9fb9e3ef..2f106aed 100644 --- a/src/libwalletqt/Wallet.cpp +++ b/src/libwalletqt/Wallet.cpp @@ -524,6 +524,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); |
