Merge pull request #612

d730766 useForkRules() - Catch no connection error (Jaquee)
This commit is contained in:
Riccardo Spagni 2017-03-27 21:22:08 +02:00
commit 6ba2548273
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD
2 changed files with 9 additions and 2 deletions

View file

@ -589,7 +589,14 @@ bool Wallet::rescanSpent()
bool Wallet::useForkRules(quint8 required_version, quint64 earlyBlocks) const
{
return m_walletImpl->useForkRules(required_version,earlyBlocks);
if(m_connectionStatus == Wallet::ConnectionStatus_Disconnected)
return false;
try {
return m_walletImpl->useForkRules(required_version,earlyBlocks);
} catch (const std::exception &e) {
qDebug() << e.what();
return false;
}
}
Wallet::Wallet(Monero::Wallet *w, QObject *parent)

View file

@ -229,7 +229,7 @@ public:
Q_INVOKABLE bool rescanSpent();
// check if fork rules should be used
Q_INVOKABLE bool useForkRules(quint8 version, quint64 earlyBlocks) const;
Q_INVOKABLE bool useForkRules(quint8 version, quint64 earlyBlocks = 0) const;
// TODO: setListenter() when it implemented in API
signals: