func (p *Protocol) GetMasterPeers() []*peer.Peer {
	return unwrapPeers(p.mgr.masterPeers())
}
GetMasterPeers returns the list of master peers.
package discover
import (
	"bytes"
	"errors"
	"fmt"
	"net"
	"sync"
	"time"
	pb "github.com/iotaledger/hive.go/autopeering/discover/proto"
	"github.com/iotaledger/hive.go/autopeering/peer"
	peerpb "github.com/iotaledger/hive.go/autopeering/peer/proto"
	"github.com/iotaledger/hive.go/autopeering/peer/service"
	"github.com/iotaledger/hive.go/autopeering/server"
	"github.com/iotaledger/hive.go/backoff"
	"github.com/iotaledger/hive.go/identity"
	"github.com/iotaledger/hive.go/logger"
	"github.com/iotaledger/hive.go/netutil"
	"github.com/iotaledger/hive.go/typeutils"
	"google.golang.org/protobuf/proto"
)
const (
	backoffInterval = 500 * time.Millisecond
	maxRetries      = 2
	logSends        = true
)
var retryPolicy = backoff.ExponentialBackOff(backoffInterval, 1.5).With(
	backoff.Jitter(0.5), backoff.MaxRetries(maxRetries))
type Protocol struct {
	server.Protocol
	loc     *peer.Local     
	version uint32          
	netID   uint32          
	log     *logger.Logger  
	mgr       *manager  
	running   *typeutils.AtomicBool
	closeOnce sync.Once
}
func New(local *peer.Local, version uint32, networkID uint32, opts ...Option) *Protocol {
	args := &options{
		log:         logger.NewNopLogger(),
		masterPeers: nil,
	}
	for _, opt := range opts {
		opt.apply(args)
	}
	p := &Protocol{
		loc:     local,
		version: version,
		netID:   networkID,
		log:     args.log,
		running: typeutils.NewAtomicBool(),
	}
	p.mgr = newManager(p, args.masterPeers, args.log.Named("mgr"))
	return p
}
func (p *Protocol) Start(s server.Sender) {
	p.Protocol.Sender = s
	p.mgr.start()
	p.log.Debug("discover started")
	p.running.Set()
}
func (p *Protocol) Close() {
	p.closeOnce.Do(func() {
		p.running.UnSet()
		p.mgr.close()
	})
}
func (p *Protocol) Events() Events {
	return p.mgr.events
}
func (p *Protocol) IsVerified(id identity.ID, ip net.IP) bool {
	return time.Since(p.loc.Database().LastPong(id, ip)) < PingExpiration
}
func (p *Protocol) EnsureVerified(peer *peer.Peer) error {
	if !p.hasVerified(peer.ID(), peer.IP()) {
		if err := p.Ping(peer); err != nil {
			return err
		}
		time.Sleep(server.ResponseTimeout)
	}
	return nil
}