OSDN Git Service

add fast sync func (#204)
[bytom/vapor.git] / netsync / chainmgr / tool_test.go
index e354984..6381641 100644 (file)
@@ -5,7 +5,7 @@ import (
        "math/rand"
        "net"
 
-       wire "github.com/tendermint/go-wire"
+       "github.com/tendermint/go-wire"
        "github.com/tendermint/tmlibs/flowrate"
 
        "github.com/vapor/consensus"
@@ -89,8 +89,11 @@ func NewPeerSet() *PeerSet {
        return &PeerSet{}
 }
 
-func (ps *PeerSet) AddBannedPeer(string) error { return nil }
-func (ps *PeerSet) StopPeerGracefully(string)  {}
+func (ps *PeerSet) IsBanned(peerID string, level byte, reason string) bool {
+       return false
+}
+
+func (ps *PeerSet) StopPeerGracefully(string) {}
 
 type NetWork struct {
        nodes map[*Manager]P2PPeer
@@ -120,7 +123,8 @@ func (nw *NetWork) HandsShake(nodeA, nodeB *Manager) (*P2PPeer, *P2PPeer, error)
 
        nodeA.AddPeer(&A2B)
        nodeB.AddPeer(&B2A)
-
+       nodeA.SendStatus(B2A.srcPeer)
+       nodeB.SendStatus(A2B.srcPeer)
        A2B.setAsync(true)
        B2A.setAsync(true)
        return &B2A, &A2B, nil