fix non-wrapped proto messages in statesync

This commit is contained in:
William Banfield
2022-10-19 14:10:27 -04:00
parent cfe2ca68da
commit fd234903b6
2 changed files with 5 additions and 4 deletions

View File

@@ -130,15 +130,16 @@ func (r *Reactor) Receive(chID byte, src p2p.Peer, msgBytes []byte) {
for _, snapshot := range snapshots {
r.Logger.Debug("Advertising snapshot", "height", snapshot.Height,
"format", snapshot.Format, "peer", src.ID())
m := mustEncodeMsg()
e := p2p.Envelope{
ChannelID: chID,
Message: &ssproto.SnapshotsResponse{
Message: toWrappedProto(&ssproto.SnapshotsResponse{
Height: snapshot.Height,
Format: snapshot.Format,
Chunks: snapshot.Chunks,
Hash: snapshot.Hash,
Metadata: snapshot.Metadata,
},
}),
}
src.Send(e)
}

View File

@@ -473,11 +473,11 @@ func (s *syncer) requestChunk(snapshot *snapshot, chunk uint32) {
"format", snapshot.Format, "chunk", chunk, "peer", peer.ID())
e := p2p.Envelope{
ChannelID: ChunkChannel,
Message: &ssproto.ChunkRequest{
Message: toWrappedProto(&ssproto.ChunkRequest{
Height: snapshot.Height,
Format: snapshot.Format,
Index: chunk,
},
}),
}
peer.Send(e)
}