From 761cd77e93f733729a556e9c18703bad79d5532c Mon Sep 17 00:00:00 2001 From: Huseyin ABANOZ Date: Wed, 16 Oct 2019 23:46:21 +0300 Subject: [PATCH] fix https://github.com/habanoz/tezos-reward-distributor/issues/105 attmpt 2 --- src/rpc/lrpc_reward_api.py | 2 +- src/rpc/prpc_reward_api.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpc/lrpc_reward_api.py b/src/rpc/lrpc_reward_api.py index a770fed2..1a27d339 100644 --- a/src/rpc/lrpc_reward_api.py +++ b/src/rpc/lrpc_reward_api.py @@ -93,7 +93,7 @@ def __get_unfrozen_rewards(self, level_of_last_block_in_unfreeze_cycle, cycle): balance_update = balance_updates[i] if balance_update["kind"] == "freezer": if balance_update["delegate"] == self.baking_address: - if int(balance_update["cycle"]) != cycle or int(balance_update["change"])>0: + if int(balance_update["cycle"]) == cycle or int(balance_update["change"])<0: if balance_update["category"] == "rewards": unfrozen_rewards = -int(balance_update["change"]) logger.debug("[__get_unfrozen_rewards] Found balance update for reward {}".format(balance_update)) diff --git a/src/rpc/prpc_reward_api.py b/src/rpc/prpc_reward_api.py index 781e1143..789cd074 100644 --- a/src/rpc/prpc_reward_api.py +++ b/src/rpc/prpc_reward_api.py @@ -92,7 +92,7 @@ def __get_unfrozen_rewards(self, level_of_last_block_in_unfreeze_cycle, cycle): balance_update = balance_updates[i] if balance_update["kind"] == "freezer": if balance_update["delegate"] == self.baking_address: - if int(balance_update["cycle"]) != cycle or int(balance_update["change"])>0: + if int(balance_update["cycle"]) == cycle or int(balance_update["change"]) < 0: if balance_update["category"] == "rewards": unfrozen_rewards = -int(balance_update["change"]) logger.debug("[__get_unfrozen_rewards] Found balance update for reward {}".format(balance_update))