last_prepared_sertificate only from prepare
@@ -1652,7 +1652,12 @@ class Replica(HasActionQueue, MessageProcessor, HookManager):
# TODO: Consider stashed messages too?
if not self.isMaster:
raise LogicError("{} is not a master".format(self))
- return max_3PC_key(self.commits.keys()) if self.commits else None
+ keys = []
+ quorum = self.quorums.prepare.value
+ for key in self.prepares.keys():
+ if self.prepares.hasQuorum(ThreePhaseKey(*key), quorum):
+ keys.append(key)
+ return max_3PC_key(keys) if keys else None
def has_prepared(self, key):
return self.getPrePrepare(*key) and self.prepares.hasQuorum(
