tests compile

This commit is contained in:
William Banfield
2022-10-19 12:28:39 -04:00
parent 5795877dbc
commit 01db5dc019
13 changed files with 174 additions and 67 deletions

View File

@@ -149,15 +149,14 @@ func (bcR *Reactor) GetChannels() []*p2p.ChannelDescriptor {
// AddPeer implements Reactor by sending our state to peer.
func (bcR *Reactor) AddPeer(peer p2p.Peer) {
msgBytes, err := EncodeMsg(&bcproto.StatusResponse{
Base: bcR.store.Base(),
Height: bcR.store.Height()})
if err != nil {
bcR.Logger.Error("could not convert msg to protobuf", "err", err)
return
e := p2p.Envelope{
ChannelID: BlocksyncChannel,
Message: &bcproto.StatusResponse{
Base: bcR.store.Base(),
Height: bcR.store.Height(),
},
}
peer.Send(BlocksyncChannel, msgBytes)
peer.NewSend(e)
// it's OK if send fails. will try later in poolRoutine
// peer is added to the pool once we receive the first