Example #1
0
 def _process_newer_ledger_status(self, ledger_status: LedgerStatus,
                                  frm: str):
     # If we are behind the node which has sent the ledger status
     # then send our ledger status to it
     # in order to get the consistency proof from it
     my_ledger_status = build_ledger_status(self._ledger_id, self._provider)
     self._provider.send_to(my_ledger_status, frm)
     self._schedule_reask_last_cons_proof(frm)
Example #2
0
 def _reask_for_last_consistency_proof(self):
     ledger_status = build_ledger_status(self._ledger_id, self._provider)
     nodes = [
         node_name for node_name in self._provider.all_nodes_names()
         if node_name not in self._cons_proofs
         and node_name != self._provider.node_name()
     ]
     self._provider.send_to_nodes(ledger_status, nodes=nodes)
Example #3
0
 def _on_ledger_status_up_to_date(self, ledger_id: int, frm: str):
     ledger_status = build_ledger_status(ledger_id, self._provider)
     self._provider.send_to(ledger_status, frm)