aboutsummaryrefslogtreecommitdiffstats
path: root/ethereum.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-01-31 06:48:52 +0800
committerobscuren <geffobscura@gmail.com>2014-01-31 06:48:52 +0800
commit7ccf51fd3035aaba8ed3eda0ca8e3b01edaaa2cf (patch)
tree3dfdea38615bc6f4fc6cd6ed231340cfe217f895 /ethereum.go
parent3e400739a77c8d2555ea74ae1544b483b375a960 (diff)
downloadgo-tangerine-7ccf51fd3035aaba8ed3eda0ca8e3b01edaaa2cf.tar
go-tangerine-7ccf51fd3035aaba8ed3eda0ca8e3b01edaaa2cf.tar.gz
go-tangerine-7ccf51fd3035aaba8ed3eda0ca8e3b01edaaa2cf.tar.bz2
go-tangerine-7ccf51fd3035aaba8ed3eda0ca8e3b01edaaa2cf.tar.lz
go-tangerine-7ccf51fd3035aaba8ed3eda0ca8e3b01edaaa2cf.tar.xz
go-tangerine-7ccf51fd3035aaba8ed3eda0ca8e3b01edaaa2cf.tar.zst
go-tangerine-7ccf51fd3035aaba8ed3eda0ca8e3b01edaaa2cf.zip
Updated seed peers
Diffstat (limited to 'ethereum.go')
-rw-r--r--ethereum.go14
1 files changed, 9 insertions, 5 deletions
diff --git a/ethereum.go b/ethereum.go
index 5eaf31d12..72d023f5c 100644
--- a/ethereum.go
+++ b/ethereum.go
@@ -72,10 +72,13 @@ func (s *Ethereum) AddPeer(conn net.Conn) {
peer := NewPeer(conn, s, true)
if peer != nil {
- s.peers.PushBack(peer)
- peer.Start()
-
- log.Println("Peer connected ::", conn.RemoteAddr())
+ if s.peers.Len() > -1 {
+ log.Println("SEED")
+ peer.Start(true)
+ } else {
+ s.peers.PushBack(peer)
+ peer.Start(false)
+ }
}
}
@@ -164,8 +167,9 @@ func (s *Ethereum) Start() {
} else {
// Starting accepting connections
go func() {
+ log.Println("Ready and accepting connections")
+
for {
- log.Println("Ready and accepting connections")
conn, err := ln.Accept()
if err != nil {
log.Println(err)