diff options
| author | Jacob Brydolf <jacob@brydolf.net> | 2016-10-10 21:36:57 +0200 |
|---|---|---|
| committer | Jacob Brydolf <jacob@brydolf.net> | 2016-10-10 21:36:57 +0200 |
| commit | 06d628b6961cea576f4ce26931b546c557707720 (patch) | |
| tree | 3ced462b69aaea338a1f30b083d69125b3352bba /src | |
| parent | 1ca4fd24ef5d152eb5e4a3e77d715104195ddf34 (diff) | |
| download | monzero-gui-06d628b6961cea576f4ce26931b546c557707720.tar.gz monzero-gui-06d628b6961cea576f4ce26931b546c557707720.tar.xz monzero-gui-06d628b6961cea576f4ce26931b546c557707720.zip | |
libwalletqt: added isRecovering state
Diffstat (limited to 'src')
| -rw-r--r-- | src/libwalletqt/Wallet.cpp | 10 | ||||
| -rw-r--r-- | src/libwalletqt/Wallet.h | 4 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp index b52963bc..3c8858b5 100644 --- a/src/libwalletqt/Wallet.cpp +++ b/src/libwalletqt/Wallet.cpp @@ -115,13 +115,18 @@ bool Wallet::store(const QString &path) return m_walletImpl->store(path.toStdString()); } -bool Wallet::init(const QString &daemonAddress, quint64 upperTransactionLimit) +bool Wallet::init(const QString &daemonAddress, quint64 upperTransactionLimit, bool isRecovering, quint64 restoreHeight) { return m_walletImpl->init(daemonAddress.toStdString(), upperTransactionLimit); } -void Wallet::initAsync(const QString &daemonAddress, quint64 upperTransactionLimit) +void Wallet::initAsync(const QString &daemonAddress, quint64 upperTransactionLimit, bool isRecovering, quint64 restoreHeight) { + if (isRecovering){ + qDebug() << "RESTORING"; + m_walletImpl->setRecoveringFromSeed(true); + m_walletImpl->setRefreshFromBlockHeight(restoreHeight); + } m_walletImpl->initAsync(daemonAddress.toStdString(), upperTransactionLimit); } @@ -263,6 +268,5 @@ Wallet::Wallet(Bitmonero::Wallet *w, QObject *parent) Wallet::~Wallet() { - Bitmonero::WalletManagerFactory::getWalletManager()->closeWallet(m_walletImpl); } diff --git a/src/libwalletqt/Wallet.h b/src/libwalletqt/Wallet.h index d794550a..6267f411 100644 --- a/src/libwalletqt/Wallet.h +++ b/src/libwalletqt/Wallet.h @@ -74,10 +74,10 @@ public: Q_INVOKABLE bool store(const QString &path); //! initializes wallet - Q_INVOKABLE bool init(const QString &daemonAddress, quint64 upperTransactionLimit); + Q_INVOKABLE bool init(const QString &daemonAddress, quint64 upperTransactionLimit, bool isRecovering = false, quint64 restoreHeight = 0); //! initializes wallet asynchronously - Q_INVOKABLE void initAsync(const QString &daemonAddress, quint64 upperTransactionLimit); + Q_INVOKABLE void initAsync(const QString &daemonAddress, quint64 upperTransactionLimit, bool isRecovering = false, quint64 restoreHeight = 0); //! connects to daemon Q_INVOKABLE bool connectToDaemon(); |
