Documentation ¶
Index ¶
Constants ¶
View Source
const BanReleaseDuration = time.Hour * 24 * 730
View Source
const BanThreshold = 5
BanThreshold is number of events to ban address or peerid
View Source
const BanValidDuration = time.Minute * 30
Variables ¶
View Source
var ( NotFoundError = errors.New("ban status not found") UndefinedTime = time.Unix(0, 0) FarawayFuture = time.Date(99999, 1, 1, 0, 0, 0, 0, time.UTC) )
variables that are used internally
Functions ¶
func NewListManager ¶
func NewListManager(conf *config.AuthConfig, authDir string, chainAcc types.ChainAccessor, prm p2pcommon.PeerRoleManager, logger *log.Logger, publicNet bool) p2pcommon.ListManager
Types ¶
type BanStatus ¶
type BanStatus interface { // ID is ip address or peer id ID() string // BanUntil show when this ban items is expired. BanUntil() time.Time Banned(refTime time.Time) bool Events() []BanEvent PruneOldEvents(pruneTime time.Time) int }
BanStatus keep kickout logs and decide how long the ban duration is
Click to show internal directories.
Click to hide internal directories.