Black listing of bad peers
This commit is contained in:
@ -69,6 +69,8 @@ type Ethereum struct {
|
||||
Addr net.Addr
|
||||
Port string
|
||||
|
||||
blacklist [][]byte
|
||||
|
||||
peerMut sync.Mutex
|
||||
|
||||
// Capabilities for outgoing peers
|
||||
@ -211,6 +213,10 @@ func (s *Ethereum) HighestTDPeer() (td *big.Int) {
|
||||
return
|
||||
}
|
||||
|
||||
func (self *Ethereum) BlacklistPeer(peer *Peer) {
|
||||
self.blacklist = append(self.blacklist, peer.pubkey)
|
||||
}
|
||||
|
||||
func (s *Ethereum) AddPeer(conn net.Conn) {
|
||||
peer := NewPeer(conn, s, true)
|
||||
|
||||
|
Reference in New Issue
Block a user