diff options
author | obscuren <geffobscura@gmail.com> | 2014-10-02 23:03:48 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-10-02 23:03:48 +0800 |
commit | a75c92000fab997a41479c8f92e62f6b0d3f3434 (patch) | |
tree | 608ee0538946d1fa780d1fbfb8701ce544b09e3d /ethereum.go | |
parent | b55e017e620d8049788eda91424d4944ac934613 (diff) | |
download | go-tangerine-a75c92000fab997a41479c8f92e62f6b0d3f3434.tar.gz go-tangerine-a75c92000fab997a41479c8f92e62f6b0d3f3434.tar.zst go-tangerine-a75c92000fab997a41479c8f92e62f6b0d3f3434.zip |
Black listing of bad peers
Diffstat (limited to 'ethereum.go')
-rw-r--r-- | ethereum.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ethereum.go b/ethereum.go index 5fb3f2909..013214726 100644 --- a/ethereum.go +++ b/ethereum.go @@ -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) |