package pubsub

import (
	

	

	
)

// Blacklist is an interface for peer blacklisting.
type Blacklist interface {
	Add(peer.ID) bool
	Contains(peer.ID) bool
}

// MapBlacklist is a blacklist implementation using a perfect map
type MapBlacklist map[peer.ID]struct{}

// NewMapBlacklist creates a new MapBlacklist
func () Blacklist {
	return MapBlacklist(make(map[peer.ID]struct{}))
}

func ( MapBlacklist) ( peer.ID) bool {
	[] = struct{}{}
	return true
}

func ( MapBlacklist) ( peer.ID) bool {
	,  := []
	return 
}

// TimeCachedBlacklist is a blacklist implementation using a time cache
type TimeCachedBlacklist struct {
	tc timecache.TimeCache
}

// NewTimeCachedBlacklist creates a new TimeCachedBlacklist with the given expiry duration
func ( time.Duration) (Blacklist, error) {
	 := &TimeCachedBlacklist{tc: timecache.NewTimeCache()}
	return , nil
}

// Add returns a bool saying whether Add of peer was successful
func ( *TimeCachedBlacklist) ( peer.ID) bool {
	 := .String()
	if .tc.Has() {
		return false
	}
	.tc.Add()
	return true
}

func ( *TimeCachedBlacklist) ( peer.ID) bool {
	return .tc.Has(.String())
}