Skip to content

Commit

Permalink
Fix none finalised reqs in case of not participating (#574)
Browse files Browse the repository at this point in the history
* Fix none finalised reqs in case of not participating

Signed-off-by: dsurnin <[email protected]>

* Move add instruction after apply

Signed-off-by: dsurnin <[email protected]>
  • Loading branch information
dsurnin authored and ashcherbakov committed Mar 16, 2018
1 parent e3148f9 commit 0b8d0cb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions plenum/server/replica.py
Original file line number Diff line number Diff line change
Expand Up @@ -860,16 +860,16 @@ def can_process_since_view_change_in_progress(self, msg):

def _process_valid_preprepare(self, pre_prepare, sender):
# TODO: rename to apply_pre_prepare
old_state_root = self.stateRootHash(pre_prepare.ledgerId, to_str=False)
why_not_applied = self._apply_pre_prepare(pre_prepare, sender)
if why_not_applied is not None:
return why_not_applied
key = (pre_prepare.viewNo, pre_prepare.ppSeqNo)
self.addToPrePrepares(pre_prepare)
if not self.node.isParticipating:
self.stashingWhileCatchingUp.add(key)
self.logger.warning('{} stashing PRE-PREPARE{}'.format(self, key))
return None
old_state_root = self.stateRootHash(pre_prepare.ledgerId, to_str=False)
why_not_applied = self._apply_pre_prepare(pre_prepare, sender)
if why_not_applied is not None:
return why_not_applied
self.addToPrePrepares(pre_prepare)
if self.isMaster:
# TODO: can old_state_root be used here instead?
state_root = self.stateRootHash(pre_prepare.ledgerId, to_str=False)
Expand Down

0 comments on commit 0b8d0cb

Please sign in to comment.