forked from TrueCloudLab/neoneo-go
[server]
- remove extra call after adding a peer - switched endian for headers endian switch
This commit is contained in:
parent
336fc02ad5
commit
12149c9379
2 changed files with 2 additions and 16 deletions
|
@ -1,7 +1,6 @@
|
||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/hex"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
@ -9,7 +8,6 @@ import (
|
||||||
"github.com/CityOfZion/neo-go/pkg/connmgr"
|
"github.com/CityOfZion/neo-go/pkg/connmgr"
|
||||||
|
|
||||||
"github.com/CityOfZion/neo-go/pkg/peer"
|
"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"
|
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)
|
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) {
|
func (s *Server) onAccept(conn net.Conn) {
|
||||||
|
|
|
@ -95,7 +95,8 @@ func (s *Server) Run() error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err = s.pmg.RequestHeaders(bestHeader.Hash.Reverse())
|
|
||||||
|
err = s.pmg.RequestHeaders(bestHeader.Hash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue