firewall

package
v0.9.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2022 License: Apache-2.0, BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FaultinessDetails

type FaultinessDetails struct {
	Reason string                 `json:"reason"`
	Info   map[string]interface{} `json:"info"`
}

FaultinessDetails contains information about why the peers is considered faulty.

type Firewall

type Firewall struct {
	// contains filtered or unexported fields
}

Firewall is a object responsible for taking actions on faulty peers.

func NewFirewall

func NewFirewall(p2pManager *p2p.Manager, autopeering *selection.Protocol, log *logger.Logger) (*Firewall, error)

NewFirewall create a new instance of Firewall object.

func (*Firewall) GetPeerFaultinessCount

func (f *Firewall) GetPeerFaultinessCount(peerID identity.ID) int

GetPeerFaultinessCount returns number of times the peer has been considered faulty.

func (*Firewall) HandleFaultyPeer

func (f *Firewall) HandleFaultyPeer(peerID identity.ID, details *FaultinessDetails)

HandleFaultyPeer handles a faulty peer and takes appropriate actions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL