diff options
| author | Jaquee <jaquee.monero@gmail.com> | 2017-01-31 10:32:41 +0100 |
|---|---|---|
| committer | Jaquee <jaquee.monero@gmail.com> | 2017-01-31 10:39:03 +0100 |
| commit | eb909e1ae77ea842ef95e7b352cfeb9e58dddcfc (patch) | |
| tree | 1c4a9b659ce04f0c828cb916e2b86cb459320716 /src/libwalletqt/Wallet.h | |
| parent | cb3281dee80edd9f811bdb80be3e3df7555a2daf (diff) | |
| download | monzero-gui-eb909e1ae77ea842ef95e7b352cfeb9e58dddcfc.tar.gz monzero-gui-eb909e1ae77ea842ef95e7b352cfeb9e58dddcfc.tar.xz monzero-gui-eb909e1ae77ea842ef95e7b352cfeb9e58dddcfc.zip | |
async connectionStatus and init
Diffstat (limited to 'src/libwalletqt/Wallet.h')
| -rw-r--r-- | src/libwalletqt/Wallet.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/libwalletqt/Wallet.h b/src/libwalletqt/Wallet.h index 9aec45fc..7e9651e4 100644 --- a/src/libwalletqt/Wallet.h +++ b/src/libwalletqt/Wallet.h @@ -3,6 +3,8 @@ #include <QObject> #include <QTime> +#include <QMutex> +#include <QtConcurrent/QtConcurrent> #include "wallet/wallet2_api.h" // we need to have an access to the Monero::Wallet::Status enum here; #include "PendingTransaction.h" // we need to have an access to the PendingTransaction::Priority enum here; @@ -75,7 +77,8 @@ public: bool testnet() const; //! returns whether the wallet is connected, and version status - ConnectionStatus connected() const; + ConnectionStatus connected(bool forceCheck = false); + void updateConnectionStatusAsync(); //! returns true if wallet was ever synchronized bool synchronized() const; @@ -98,10 +101,10 @@ public: Q_INVOKABLE bool store(const QString &path = ""); //! initializes wallet - Q_INVOKABLE bool init(const QString &daemonAddress, quint64 upperTransactionLimit, bool isRecovering = false, quint64 restoreHeight = 0); + Q_INVOKABLE bool init(const QString &daemonAddress, quint64 upperTransactionLimit = 0, bool isRecovering = false, quint64 restoreHeight = 0); //! initializes wallet asynchronously - Q_INVOKABLE void initAsync(const QString &daemonAddress, quint64 upperTransactionLimit, bool isRecovering = false, quint64 restoreHeight = 0); + Q_INVOKABLE void initAsync(const QString &daemonAddress, quint64 upperTransactionLimit = 0, bool isRecovering = false, quint64 restoreHeight = 0); //! create a view only wallet Q_INVOKABLE bool createViewOnly(const QString &path, const QString &password) const; @@ -231,13 +234,13 @@ signals: void moneySpent(const QString &txId, quint64 amount); void moneyReceived(const QString &txId, quint64 amount); void unconfirmedMoneyReceived(const QString &txId, quint64 amount); - void newBlock(quint64 height); + void newBlock(quint64 height, quint64 targetHeight); void historyModelChanged() const; // emitted when transaction is created async void transactionCreated(PendingTransaction * transaction, QString address, QString paymentId, quint32 mixinCount); - void connectionStatusChanged() const; + void connectionStatusChanged(ConnectionStatus status) const; private: Wallet(QObject * parent = nullptr); @@ -266,6 +269,8 @@ private: mutable bool m_initialized; AddressBook * m_addressBook; mutable AddressBookModel * m_addressBookModel; + QMutex m_connectionStatusMutex; + bool m_connectionStatusRunning; }; |
