Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

Commit

Permalink
[LC-219] Don't treat continuous leader complain.
Browse files Browse the repository at this point in the history
  • Loading branch information
windies21 committed Mar 7, 2019
1 parent 53eac4b commit c1a4070
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion loopchain/blockchain/epoch.py
Expand Up @@ -33,7 +33,6 @@ def __init__(self, block_manager, leader_id=None):
else:
self.height = 1
self.leader_id = leader_id
self.next_leader_id = None
self.__block_manager = block_manager
self.__blockchain = self.__block_manager.get_blockchain()
util.logger.debug(f"New Epoch Start height({self.height }) leader_id({leader_id})")
Expand Down
2 changes: 2 additions & 0 deletions loopchain/channel/channel_service.py
Expand Up @@ -759,6 +759,8 @@ def reset_leader_complain_timer(self):
if timer:
self.stop_leader_complain_timer()
duration = min(timer.duration * 2, conf.MAX_TIMEOUT_FOR_LEADER_COMPLAIN)

# utils.logger.notice(f"reset_leader_complain_timer duration({duration})")
self.start_leader_complain_timer(duration=duration)

def start_leader_complain_timer(self, duration=None):
Expand Down
2 changes: 0 additions & 2 deletions loopchain/channel/channel_statemachine.py
Expand Up @@ -160,10 +160,8 @@ def _blockgenerate_on_exit(self):
def _leadercomplain_on_enter(self):
util.logger.debug(f"_leadercomplain_on_enter")
self.__channel_service.block_manager.leader_complain()
self.__channel_service.start_leader_complain_timer()

def _leadercomplain_on_exit(self):
util.logger.debug(f"_leadercomplain_on_exit")
self.__channel_service.stop_leader_complain_timer()

# }
1 change: 1 addition & 0 deletions loopchain/peer/block_manager.py
Expand Up @@ -691,6 +691,7 @@ def stop(self):
self.consensus_algorithm.stop()

def leader_complain(self):
# util.logger.notice(f"do leader complain.")
new_leader_id = self.epoch.pop_complained_candidate_leader()
complained_leader_id = self.epoch.leader_id

Expand Down

0 comments on commit c1a4070

Please sign in to comment.