func (s *SyncManager) PeerConnected(id peer.ID, dir network.Direction) {
	if dir == network.DirInbound {
		genesisHash := s.blockchain.GenesisHash()

		logrus.WithField("to", id).Info("sending version message")

		err := s.protocol.SendMessage(id, &pb.BeaconVersionMessage{
			Version:     syncVersion,
			GenesisHash: genesisHash[:],
			Height:      s.blockchain.Height(),
		})
		if err != nil {
			logrus.WithField("type", "sync manager connected").WithField("peer", id).Error(err)
		}
	}
}
// PeerConnected is called when a peer connects.
PeerConnected is called when a peer connects.
// PeerConnected is called when a peer connects .
func (s *SyncManager) PeerConnected(id peer.ID, dir network.Direction) {
	if dir == network.DirInbound {
		genesisHash := s.blockchain.GenesisHash()
		logrus.WithField("to", id).Info("sending version message")
		err := s.protocol.SendMessage(id, &pb.BeaconVersionMessage{
			Version:     syncVersion,
			GenesisHash: genesisHash[:],
			Height:      s.blockchain.Height(),
		})
		if err != nil {
			logrus.WithField("type", "sync manager connected").WithField("peer", id).Error(err)
		}
	}
}
func ( s * SyncManager ) PeerConnected ( id peer . ID , dir network . Direction ) { if dir == network . DirInbound { genesisHash := s . blockchain . GenesisHash ( ) logrus . WithField ( " " , id ) . Info ( " " ) err := s . protocol . SendMessage ( id , & pb . BeaconVersionMessage { Version : syncVersion , GenesisHash : genesisHash [ : ] , Height : s . blockchain . Height ( ) , } ) if err != nil { logrus . WithField ( " " , " " ) . WithField ( " " , id ) . Error ( err ) } } }
PeerConnected is called when a peer connects.
PeerConnected is called when a peer connects .