aboutsummaryrefslogtreecommitdiffstats
path: root/ethereum.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-10-02 23:03:48 +0800
committerobscuren <geffobscura@gmail.com>2014-10-02 23:03:48 +0800
commita75c92000fab997a41479c8f92e62f6b0d3f3434 (patch)
tree608ee0538946d1fa780d1fbfb8701ce544b09e3d /ethereum.go
parentb55e017e620d8049788eda91424d4944ac934613 (diff)
downloadgo-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.go6
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)