QML: Check passwords with WalletDB instances that have no storage,
to avoid unwanted side effects. In qedaemon, call load_wallet with upgrade=True when loading a wallet. Apparently, this was not done before; db upgrades were performed as a side-effect of password verification...
This commit is contained in:
@@ -203,7 +203,7 @@ class QEDaemon(AuthMixin, QObject):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
local_password = password # need this in local scope
|
local_password = password # need this in local scope
|
||||||
wallet = self.daemon.load_wallet(self._path, local_password)
|
wallet = self.daemon.load_wallet(self._path, local_password, upgrade=True)
|
||||||
|
|
||||||
if wallet is None:
|
if wallet is None:
|
||||||
self._logger.info('could not open wallet')
|
self._logger.info('could not open wallet')
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ class QEWalletDB(QObject):
|
|||||||
self._validPassword = True
|
self._validPassword = True
|
||||||
|
|
||||||
self._storage = None
|
self._storage = None
|
||||||
self._db = None
|
|
||||||
|
|
||||||
self._ready = False
|
self._ready = False
|
||||||
|
|
||||||
@@ -143,7 +142,7 @@ class QEWalletDB(QObject):
|
|||||||
else: # storage not encrypted; but it might still have a keystore pw
|
else: # storage not encrypted; but it might still have a keystore pw
|
||||||
# FIXME hack... load both db and full wallet, just to tell if it has keystore pw.
|
# FIXME hack... load both db and full wallet, just to tell if it has keystore pw.
|
||||||
try:
|
try:
|
||||||
db = WalletDB(self._storage.read(), storage=self._storage, upgrade=True)
|
db = WalletDB(self._storage.read(), storage=None, upgrade=True)
|
||||||
except WalletRequiresSplit as e:
|
except WalletRequiresSplit as e:
|
||||||
raise WalletFileException(_('This wallet requires to be split. This is currently not supported on mobile'))
|
raise WalletFileException(_('This wallet requires to be split. This is currently not supported on mobile'))
|
||||||
wallet = Wallet(db, config=self._config)
|
wallet = Wallet(db, config=self._config)
|
||||||
@@ -165,11 +164,11 @@ class QEWalletDB(QObject):
|
|||||||
"""can raise WalletFileException"""
|
"""can raise WalletFileException"""
|
||||||
# needs storage accessible
|
# needs storage accessible
|
||||||
try:
|
try:
|
||||||
self._db = WalletDB(self._storage.read(), storage=self._storage, upgrade=True)
|
db = WalletDB(self._storage.read(), storage=None, upgrade=True)
|
||||||
except WalletRequiresSplit as e:
|
except WalletRequiresSplit as e:
|
||||||
self._logger.warning('wallet requires split')
|
self._logger.warning('wallet requires split')
|
||||||
raise WalletFileException(_('This wallet needs splitting. This is not supported on mobile'))
|
raise WalletFileException(_('This wallet needs splitting. This is not supported on mobile'))
|
||||||
if self._db.get_action():
|
if db.get_action():
|
||||||
self._logger.warning('action pending. QML version doesn\'t support continuation of wizard')
|
self._logger.warning('action pending. QML version doesn\'t support continuation of wizard')
|
||||||
raise WalletFileException(_('This wallet has an action pending. This is currently not supported on mobile'))
|
raise WalletFileException(_('This wallet has an action pending. This is currently not supported on mobile'))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user