Skip to content
Snippets Groups Projects
Commit ae0613aa authored by inso's avatar inso
Browse files

Sakia is only able to use one currency/database

parent 43423a41
No related branches found
No related tags found
No related merge requests found
...@@ -130,7 +130,8 @@ class ConnectionConfigController(QObject): ...@@ -130,7 +130,8 @@ class ConnectionConfigController(QObject):
self.password_asker = PasswordAskerDialog(self.model.connection) self.password_asker = PasswordAskerDialog(self.model.connection)
except (DisconnectedError, ClientError, MalformedDocumentError, ValueError, TimeoutError) as e: except (DisconnectedError, ClientError, MalformedDocumentError, ValueError, TimeoutError) as e:
self._logger.debug(str(e)) self._logger.debug(str(e))
self.view.display_info(self.tr("Could not connect. Check hostname, ip address or port : </br>str(e)")) self.view.display_info(self.tr("Could not connect. Check hostname, ip address or port : <br/>"
+ str(e)))
self.step_node = asyncio.Future() self.step_node = asyncio.Future()
self.view.button_connect.setEnabled(True) self.view.button_connect.setEnabled(True)
self.view.button_register.setEnabled(True) self.view.button_register.setEnabled(True)
......
...@@ -30,8 +30,13 @@ class ConnectionConfigModel(QObject): ...@@ -30,8 +30,13 @@ class ConnectionConfigModel(QObject):
self.identities_processor = identities_processor self.identities_processor = identities_processor
async def create_connection(self, server, port, secured): async def create_connection(self, server, port, secured):
self.node_connector = await NodeConnector.from_address(None, secured, server, port, node_connector = await NodeConnector.from_address(None, secured, server, port,
user_parameters=self.app.parameters) user_parameters=self.app.parameters)
currencies = self.app.db.connections_repo.get_currencies()
if len(currencies) > 0 and node_connector.node.currency != currencies[0]:
raise ValueError("""This node is running for {0} network.<br/>
Current database is storing {1} network.""".format(node_connector.node.currency, currencies[0]))
self.node_connector = node_connector
self.connection = Connection(self.node_connector.node.currency, "", "") self.connection = Connection(self.node_connector.node.currency, "", "")
self.node_connector.node.state = Node.ONLINE self.node_connector.node.state = Node.ONLINE
......
from PyQt5.QtWidgets import QDialog from PyQt5.QtWidgets import QDialog
from PyQt5.QtCore import pyqtSignal from PyQt5.QtCore import pyqtSignal, Qt
from .connection_cfg_uic import Ui_ConnectionConfigurationDialog from .connection_cfg_uic import Ui_ConnectionConfigurationDialog
from duniterpy.key import SigningKey, ScryptParams from duniterpy.key import SigningKey, ScryptParams
from math import ceil, log from math import ceil, log
...@@ -36,6 +36,7 @@ class ConnectionConfigView(QDialog, Ui_ConnectionConfigurationDialog): ...@@ -36,6 +36,7 @@ class ConnectionConfigView(QDialog, Ui_ConnectionConfigurationDialog):
self.spin_p.setMaximum(128) self.spin_p.setMaximum(128)
self.spin_p.setValue(self.scrypt_params.p) self.spin_p.setValue(self.scrypt_params.p)
self.spin_p.valueChanged.connect(self.handle_p_change) self.spin_p.valueChanged.connect(self.handle_p_change)
self.label_info.setTextFormat(Qt.RichText)
def handle_combo_change(self, index): def handle_combo_change(self, index):
strengths = [ strengths = [
......
...@@ -200,7 +200,6 @@ class InformationsView(QWidget, Ui_InformationsWidget): ...@@ -200,7 +200,6 @@ class InformationsView(QWidget, Ui_InformationsWidget):
<tr><td align="right"><b>{:}</b></td><td>{:}</td></tr> <tr><td align="right"><b>{:}</b></td><td>{:}</td></tr>
<tr><td align="right"><b>{:}</b></td><td>{:}</td></tr> <tr><td align="right"><b>{:}</b></td><td>{:}</td></tr>
<tr><td align="right"><b>{:}</b></td><td>{:}</td></tr> <tr><td align="right"><b>{:}</b></td><td>{:}</td></tr>
<tr><td align="right"><b>{:}</b></td><td>{:}</td></tr>
<tr><td align="right"><b>{:2.0%}</b></td><td>{:}</td></tr> <tr><td align="right"><b>{:2.0%}</b></td><td>{:}</td></tr>
</table> </table>
""").format( """).format(
...@@ -218,8 +217,6 @@ class InformationsView(QWidget, Ui_InformationsWidget): ...@@ -218,8 +217,6 @@ class InformationsView(QWidget, Ui_InformationsWidget):
self.tr('The average time in seconds for writing 1 block (wished time)'), self.tr('The average time in seconds for writing 1 block (wished time)'),
params.dt_diff_eval, params.dt_diff_eval,
self.tr('The number of blocks required to evaluate again PoWMin value'), self.tr('The number of blocks required to evaluate again PoWMin value'),
params.blocks_rot,
self.tr('The number of previous blocks to check for personalized difficulty'),
params.percent_rot, params.percent_rot,
self.tr('The percent of previous issuers to reach for personalized difficulty') self.tr('The percent of previous issuers to reach for personalized difficulty')
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment