aboutsummaryrefslogtreecommitdiffstats
path: root/ethereum.go
diff options
context:
space:
mode:
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)