From 12149c93790fb2a7b613b2de54f4ce59f247c1f5 Mon Sep 17 00:00:00 2001 From: BlockChainDev Date: Sun, 31 Mar 2019 00:24:10 +0000 Subject: [PATCH] [server] - remove extra call after adding a peer - switched endian for headers endian switch --- pkg/server/connmgr.go | 15 --------------- pkg/server/server.go | 3 ++- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/pkg/server/connmgr.go b/pkg/server/connmgr.go index 64b16bdaf..e97416801 100644 --- a/pkg/server/connmgr.go +++ b/pkg/server/connmgr.go @@ -1,7 +1,6 @@ package server import ( - "encoding/hex" "fmt" "net" "strconv" @@ -9,7 +8,6 @@ import ( "github.com/CityOfZion/neo-go/pkg/connmgr" "github.com/CityOfZion/neo-go/pkg/peer" - "github.com/CityOfZion/neo-go/pkg/wire/util" iputils "github.com/CityOfZion/neo-go/pkg/wire/util/ip" ) @@ -34,19 +32,6 @@ func (s *Server) onConnection(conn net.Conn, addr string) { } s.pmg.AddPeer(p) - - byt, err := hex.DecodeString("d42561e3d30e15be6400b6df2f328e02d2bf6354c41dce433bc57687c82144bf") - if err != nil { - fmt.Println("Error getting hash " + err.Error()) - } - lh, err := util.Uint256DecodeBytes(byt) - if err != nil { - fmt.Println("Error getting hash " + err.Error()) - } - err = p.RequestHeaders(lh.Reverse()) - if err != nil { - fmt.Println(err) - } } func (s *Server) onAccept(conn net.Conn) { diff --git a/pkg/server/server.go b/pkg/server/server.go index 7730ee79b..22a781170 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -95,7 +95,8 @@ func (s *Server) Run() error { if err != nil { return err } - err = s.pmg.RequestHeaders(bestHeader.Hash.Reverse()) + + err = s.pmg.RequestHeaders(bestHeader.Hash) if err != nil { return err }