pub fn initialize(&mut self) {
        let listen_address = self.system_state.listen_address();
        info!("Start listening address={}", listen_address);

        let peers: HashSet<_> = {
            let it = self.state.peers().values().map(Verified::author);
            let it = it.chain(
                self.state()
                    .connect_list()
                    .peers()
                    .into_iter()
                    .map(|i| i.public_key),
            );
            let it = it.filter(|address| address != &self.state.our_connect_message().author());
            it.collect()
        };

        for key in peers {
            self.connect(key);
            info!("Trying to connect with peer {}", key);
        }

        let snapshot = self.blockchain.snapshot();
        let schema = NodeSchema::new(&snapshot);
        // Recover previous saved round if any.
        let round = schema.consensus_round();
        self.state.jump_round(round);
        info!("Jump to round {}", round);

        self.add_timeouts();

        // Recover cached consensus messages if any. We do this after main initialization and before
        // the start of event processing.
        let messages = schema.consensus_messages_cache();
        for msg in messages.iter() {
            self.handle_message(msg);
        }
    }
/// Performs node initialization, so it starts consensus process from the first round.
Performs node initialization, so it starts consensus process from the first round.
Performs node initialization so it starts consensus process from the first round .
pub fn initialize(&mut self) {
        let listen_address = self.system_state.listen_address();
        info!("Start listening address={}", listen_address);
        let peers: HashSet<_> = {
            let it = self.state.peers().values().map(Verified::author);
            let it = it.chain(
                self.state()
                    .connect_list()
                    .peers()
                    .into_iter()
                    .map(|i| i.public_key),
            );
            let it = it.filter(|address| address != &self.state.our_connect_message().author());
            it.collect()
        };
        for key in peers {
            self.connect(key);
            info!("Trying to connect with peer {}", key);
        }
        let snapshot = self.blockchain.snapshot();
        let schema = NodeSchema::new(&snapshot);
        // Recover previous saved round if any.
        let round = schema.consensus_round();
        self.state.jump_round(round);
        info!("Jump to round {}", round);
        self.add_timeouts();
        // Recover cached consensus messages if any. We do this after main initialization and before
        // the start of event processing.
        let messages = schema.consensus_messages_cache();
        for msg in messages.iter() {
            self.handle_message(msg);
        }
    }
pub fn initialize ( & mut self ) { let listen_address = self . system_state . listen_address ( ) ; info ! ( " " listen_address ) ; let peers : HashSet < _ > = { let it = self . state . peers ( ) . values ( ) . map ( Verified :: author ) ; let it = it . chain ( self . state ( ) . connect_list ( ) . peers ( ) . into_iter ( ) . map ( | i | i . public_key ) , ) ; let it = it . filter ( | address | address != & self . state . our_connect_message ( ) . author ( ) ) ; it . collect ( ) } ; for key in peers { self . connect ( key ) ; info ! ( " " key ) ; } let snapshot = self . blockchain . snapshot ( ) ; let schema = NodeSchema :: new ( & snapshot ) ; // Recover previous saved round if any. let round = schema . consensus_round ( ) ; self . state . jump_round ( round ) ; info ! ( " " round ) ; self . add_timeouts ( ) ; // Recover cached consensus messages if any. We do this after main initialization and before // the start of event processing. let messages = schema . consensus_messages_cache ( ) ; for msg in messages . iter ( ) { self . handle_message ( msg ) ; } }
Performs node initialization, so it starts consensus process from the first round.
Performs node initialization so it starts consensus process from the first round .
&mut self
&mut self