cfxcore/pos/protocol/message/
epoch_change.rs1use crate::{
6 pos::{
7 consensus::network::ConsensusMsg,
8 protocol::sync_protocol::{Context, Handleable},
9 },
10 sync::Error,
11};
12use diem_types::epoch_change::EpochChangeProof;
13use std::mem::discriminant;
14
15impl Handleable for EpochChangeProof {
16 fn handle(self, ctx: &Context) -> Result<(), Error> {
17 let peer_address = ctx.get_peer_account_address()?;
18 let msg = ConsensusMsg::EpochChangeProof(Box::new(self));
19 ctx.manager
20 .consensus_network_task
21 .consensus_messages_tx
22 .push((peer_address, discriminant(&msg)), (peer_address, msg))?;
23 Ok(())
24 }
25}