fn max_msg_size(msg_type: Type) -> u64 {
	match msg_type {
		Type::Error => 0,
		Type::Hand => 128,
		Type::Shake => 88,
		Type::Ping => 16,
		Type::Pong => 16,
		Type::GetPeerAddrs => 4,
		Type::PeerAddrs => 4 + (1 + 16 + 2) * MAX_PEER_ADDRS as u64,
		Type::GetHeaders => 1 + 32 * MAX_LOCATORS as u64,
		Type::Header => 365,
		Type::Headers => 2 + 365 * MAX_BLOCK_HEADERS as u64,
		Type::GetBlock => 32,
		Type::Block => MAX_BLOCK_SIZE,
		Type::GetCompactBlock => 32,
		Type::CompactBlock => MAX_BLOCK_SIZE / 10,
		Type::StemTransaction => MAX_BLOCK_SIZE,
		Type::Transaction => MAX_BLOCK_SIZE,
		Type::TxHashSetRequest => 40,
		Type::TxHashSetArchive => 64,
		Type::BanReason => 64,
		Type::GetTransaction => 32,
		Type::TransactionKernel => 32,
	}
}
// Max msg size for each msg type.
Max msg size for each msg type.
Max msg size for each msg type .
fn max_msg_size(msg_type: Type) -> u64 {
	match msg_type {
		Type::Error => 0,
		Type::Hand => 128,
		Type::Shake => 88,
		Type::Ping => 16,
		Type::Pong => 16,
		Type::GetPeerAddrs => 4,
		Type::PeerAddrs => 4 + (1 + 16 + 2) * MAX_PEER_ADDRS as u64,
		Type::GetHeaders => 1 + 32 * MAX_LOCATORS as u64,
		Type::Header => 365,
		Type::Headers => 2 + 365 * MAX_BLOCK_HEADERS as u64,
		Type::GetBlock => 32,
		Type::Block => MAX_BLOCK_SIZE,
		Type::GetCompactBlock => 32,
		Type::CompactBlock => MAX_BLOCK_SIZE / 10,
		Type::StemTransaction => MAX_BLOCK_SIZE,
		Type::Transaction => MAX_BLOCK_SIZE,
		Type::TxHashSetRequest => 40,
		Type::TxHashSetArchive => 64,
		Type::BanReason => 64,
		Type::GetTransaction => 32,
		Type::TransactionKernel => 32,
	}
}
fn max_msg_size ( msg_type : Type ) -> u64 { match msg_type { Type :: Error => 0 , Type :: Hand => 128 , Type :: Shake => 88 , Type :: Ping => 16 , Type :: Pong => 16 , Type :: GetPeerAddrs => 4 , Type :: PeerAddrs => 4 + ( 1 + 16 + 2 ) * MAX_PEER_ADDRS as u64 , Type :: GetHeaders => 1 + 32 * MAX_LOCATORS as u64 , Type :: Header => 365 , Type :: Headers => 2 + 365 * MAX_BLOCK_HEADERS as u64 , Type :: GetBlock => 32 , Type :: Block => MAX_BLOCK_SIZE , Type :: GetCompactBlock => 32 , Type :: CompactBlock => MAX_BLOCK_SIZE / 10 , Type :: StemTransaction => MAX_BLOCK_SIZE , Type :: Transaction => MAX_BLOCK_SIZE , Type :: TxHashSetRequest => 40 , Type :: TxHashSetArchive => 64 , Type :: BanReason => 64 , Type :: GetTransaction => 32 , Type :: TransactionKernel => 32 , } }
Max msg size for each msg type.
Max msg size for each msg type .
msg_type
Type