From 30ca561f53bbbeae334561cba561ce9f6a413985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalm=C3=A1r=2C=20Bal=C3=A1zs?= Date: Sat, 3 Mar 2018 11:16:05 +0100 Subject: [PATCH 1/2] Fix type error in voting Source: https://github.com/Tetricoins/sentinel/commit/48fbf36433a4a81e452db032ea9e88be985861c7 Author's description: https://bitcointalk.org/index.php?topic=2677966 --- lib/models.py | 7 ++++++- lib/vivolib.py | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/models.py b/lib/models.py index 8bfc065..d1a43ad 100644 --- a/lib/models.py +++ b/lib/models.py @@ -142,7 +142,12 @@ def import_gobject_from_vivod(self, vivod, rec): try: newdikt = subdikt.copy() newdikt['object_hash'] = object_hash - if subclass(**newdikt).is_valid() is False: + + sub, params = subclass(**newdikt), [] + if isinstance(sub, Watchdog): + params = [dashd] + + if sub.is_valid(*params) is False: govobj.vote_delete(vivod) return (govobj, None) diff --git a/lib/vivolib.py b/lib/vivolib.py index 713e37d..4028e14 100644 --- a/lib/vivolib.py +++ b/lib/vivolib.py @@ -10,6 +10,7 @@ import binascii from misc import printdbg, epoch2str import time +import config def is_valid_vivo_address(address, network='mainnet'): @@ -250,8 +251,9 @@ def did_we_vote(output): voted = False err_msg = '' + _, config_filename = os.path.split(config.vivo_conf) try: - detail = output.get('detail').get('vivo.conf') + detail = output.get('detail').get(config_filename) result = detail.get('result') if 'errorMessage' in detail: err_msg = detail.get('errorMessage') From 07870ab9fd463e4288a9d91c9de3e7c273a1e1ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalm=C3=A1r=2C=20Bal=C3=A1zs?= Date: Sun, 4 Mar 2018 12:35:19 +0100 Subject: [PATCH 2/2] vivo_host sentinel parameter This gives the opportunity to put sentinel on a different host --- lib/vivod.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/vivod.py b/lib/vivod.py index 2ad4487..9590868 100644 --- a/lib/vivod.py +++ b/lib/vivod.py @@ -15,7 +15,9 @@ class VivoDaemon(): def __init__(self, **kwargs): - host = kwargs.get('host', '127.0.0.1') + host = config.sentinel_cfg.get('vivo_host', None) + if host is None: + host = kwargs.get('host', '127.0.0.1') user = kwargs.get('user') password = kwargs.get('password') port = kwargs.get('port')