Skip to content

Commit

Permalink
fix(peer): continue the loop instead of returning from the function
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba-4chain committed Jul 4, 2024
1 parent ab59e30 commit 684dd18
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,18 +554,17 @@ func (p *Peer) handleGetDataMsg(dataMsg *wire.MsgGetData, logger *slog.Logger) {

for _, invVect := range dataMsg.InvList {
switch invVect.Type {

case wire.InvTypeTx:
logger.Debug("Request for TX", slog.String(hashKey, invVect.Hash.String()))
txRequests = append(txRequests, invVect)

case wire.InvTypeBlock:
logger.Info("Request for block", slog.String(hashKey, invVect.Hash.String()), slog.String(typeKey, invVect.Type.String()))
return
continue

default:
logger.Warn("Unknown type", slog.String(hashKey, invVect.Hash.String()), slog.String(typeKey, invVect.Type.String()))
return
continue
}
}

Expand Down

0 comments on commit 684dd18

Please sign in to comment.