diff --git a/src/cutecoin/core/net/api/bma/__init__.py b/src/cutecoin/core/net/api/bma/__init__.py index 9fb8038dc20f43ff51804c22cda9d9b20d8668ab..1b6b94bcd252ff8a5c49a1a71636f956eeee2adb 100644 --- a/src/cutecoin/core/net/api/bma/__init__.py +++ b/src/cutecoin/core/net/api/bma/__init__.py @@ -126,4 +126,4 @@ class API(object): logging.debug(url.toString(QUrl.FullyEncoded)) return reply -from . import network, blockchain, tx, wot, ud \ No newline at end of file +from . import network, blockchain, tx, wot, ud, node \ No newline at end of file diff --git a/src/cutecoin/core/net/api/bma/access.py b/src/cutecoin/core/net/api/bma/access.py index 02125a74f72607eb2be380000cd1d894fb438ce6..0178cf92a8eb19868343fc9c88ef8216b0e2e355 100644 --- a/src/cutecoin/core/net/api/bma/access.py +++ b/src/cutecoin/core/net/api/bma/access.py @@ -2,6 +2,7 @@ from PyQt5.QtCore import QObject, pyqtSlot from PyQt5.QtNetwork import QNetworkReply from . import blockchain, ConnectionHandler from .....tools.exceptions import NoPeerAvailable +from ..... import __version__ import logging import json import asyncio @@ -161,6 +162,7 @@ class BmaAccess(QObject): self._data[cache_key]['value'] = {} self._data[cache_key]['metadata']['block'] = self._network.latest_block + self._data[cache_key]['metadata']['cutecoin_version'] = __version__ if not self._compare_json(self._data[cache_key]['value'], data): self._data[cache_key]['value'] = data return True diff --git a/src/cutecoin/core/net/network.py b/src/cutecoin/core/net/network.py index ccb4716edc0cd751f8f1fc0e167e6a6e1e14c18e..26d1a4c9a1fabe61478e878afe8b2ac24c2dc402 100644 --- a/src/cutecoin/core/net/network.py +++ b/src/cutecoin/core/net/network.py @@ -186,9 +186,8 @@ class Network(QObject): node = self.nodes[index] return self._root_nodes.index(node) - @asyncio.coroutine def refresh_once(self): - for node in self.nodes: + for node in self._nodes: node.refresh() @asyncio.coroutine diff --git a/src/cutecoin/gui/network_tab.py b/src/cutecoin/gui/network_tab.py index f38eebbbfa660ef5c1719b4043776cdebd592bd4..73349efb34f90896c25bc1d5fe57977a0df3c19c 100644 --- a/src/cutecoin/gui/network_tab.py +++ b/src/cutecoin/gui/network_tab.py @@ -96,6 +96,6 @@ class NetworkTabWidget(QWidget, Ui_NetworkTabWidget): QDesktopServices.openUrl(url) def manual_nodes_refresh(self): - asyncio.async(self.community.network.refresh_once()) + self.community.network.refresh_once()