def _load_peers_from_db() -> list: blockchain = ObjectManager().channel_service.block_manager.blockchain last_block = blockchain.last_block rep_root_hash = (last_block.header.reps_hash if last_block else Hash32.fromhex(conf.CHANNEL_OPTION[ ChannelProperty().name].get('crep_root_hash'))) return blockchain.find_preps_by_roothash(rep_root_hash)
def load_peers(self) -> None: PeerLoader.load(peer_manager=self) blockchain = ObjectManager().channel_service.block_manager.blockchain reps_hash = self.reps_hash() reps_in_db = blockchain.find_preps_by_roothash(reps_hash) if not reps_in_db: preps = self.serialize_as_preps() util.logger.spam(f"in _load_peers serialize_as_preps({preps})") blockchain.write_preps(reps_hash, preps)