This commit is contained in:
Alex Sharov 2021-11-25 00:09:14 +07:00 committed by GitHub
parent 726278fd8a
commit 9d46c80046
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -338,10 +338,34 @@ func runPeer(
}
send(eth.ToProto[protocol][msg.Code], peerID, b)
case eth.GetNodeDataMsg:
if !hasSubscribers(eth.ToProto[protocol][msg.Code]) {
continue
}
b := make([]byte, msg.Size)
if _, err := io.ReadFull(msg.Payload, b); err != nil {
log.Error(fmt.Sprintf("%s: reading msg into bytes: %v", peerID, err))
}
send(eth.ToProto[protocol][msg.Code], peerID, b)
//log.Info(fmt.Sprintf("[%s] GetNodeData", peerID))
case eth.GetReceiptsMsg:
if !hasSubscribers(eth.ToProto[protocol][msg.Code]) {
continue
}
b := make([]byte, msg.Size)
if _, err := io.ReadFull(msg.Payload, b); err != nil {
log.Error(fmt.Sprintf("%s: reading msg into bytes: %v", peerID, err))
}
send(eth.ToProto[protocol][msg.Code], peerID, b)
//log.Info(fmt.Sprintf("[%s] GetReceiptsMsg", peerID))
case eth.ReceiptsMsg:
if !hasSubscribers(eth.ToProto[protocol][msg.Code]) {
continue
}
b := make([]byte, msg.Size)
if _, err := io.ReadFull(msg.Payload, b); err != nil {
log.Error(fmt.Sprintf("%s: reading msg into bytes: %v", peerID, err))
}
send(eth.ToProto[protocol][msg.Code], peerID, b)
//log.Info(fmt.Sprintf("[%s] ReceiptsMsg", peerID))
case eth.NewBlockHashesMsg:
if !hasSubscribers(eth.ToProto[protocol][msg.Code]) {