Commit 8a576e1 1 parent 6aa14b2 commit 8a576e1 Copy full SHA for 8a576e1
File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -486,8 +486,17 @@ func (gsr *graphSyncReceiver) ReceiveMessage(
486
486
ctx context.Context ,
487
487
sender peer.ID ,
488
488
incoming gsmsg.GraphSyncMessage ) {
489
- gsr .graphSync ().responseManager .ProcessRequests (ctx , sender , incoming .Requests ())
490
- gsr .graphSync ().requestManager .ProcessResponses (sender , incoming .Responses (), incoming .Blocks ())
489
+
490
+ requests := incoming .Requests ()
491
+ responses := incoming .Responses ()
492
+ blocks := incoming .Blocks ()
493
+
494
+ if len (requests ) > 0 {
495
+ gsr .graphSync ().responseManager .ProcessRequests (ctx , sender , requests )
496
+ }
497
+ if len (responses ) > 0 || len (blocks ) > 0 {
498
+ gsr .graphSync ().requestManager .ProcessResponses (sender , responses , blocks )
499
+ }
491
500
}
492
501
493
502
// ReceiveError is part of the network's Receiver interface and handles incoming
You can’t perform that action at this time.
0 commit comments