Skip to content

Commit

Permalink
trivial spelling changes in comments (#777)
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero authored Dec 27, 2024
1 parent 17db35a commit b66edee
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions bitswap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ contain wantlists or blocks.

A node sends a wantlist to tell peers which blocks it wants. When a node receives
a wantlist it should check which blocks it has from the wantlist, and consider
sending the matching blocks to the requestor.
sending the matching blocks to the requester.

When a node receives blocks that it asked for, the node should send out a
notification called a 'Cancel' to tell its peers that the node no longer
Expand Down Expand Up @@ -74,7 +74,7 @@ block, err := exchange.GetBlock(ctx, c)

Parameter Notes:

1. `ctx` is the context for this request, which can be cancelled to cancel the request
1. `ctx` is the context for this request, which can be canceled to cancel the request
2. `c` is the content ID of the block you're requesting

### Get Several Blocks Asynchronously
Expand All @@ -89,7 +89,7 @@ blockChannel, err := exchange.GetBlocks(ctx, cids)

Parameter Notes:

1. `ctx` is the context for this request, which can be cancelled to cancel the request
1. `ctx` is the context for this request, which can be canceled to cancel the request
2. `cids` is a slice of content IDs for the blocks you're requesting

### Get Related Blocks Faster With Sessions
Expand Down
12 changes: 6 additions & 6 deletions bitswap/client/internal/messagequeue/messagequeue.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ type MessageQueue struct {
cancels *cid.Set
priority int32

// Dont touch any of these variables outside of run loop
// Don't touch any of these variables outside of run loop
sender bsnet.MessageSender
rebroadcastNow chan struct{}
// For performance reasons we just clear out the fields of the message
Expand Down Expand Up @@ -160,7 +160,7 @@ func (r *recallWantlist) MarkSent(e bswl.Entry) bool {

// SentAt records the time at which a want was sent
func (r *recallWantlist) SentAt(c cid.Cid, at time.Time) {
// The want may have been cancelled in the interim
// The want may have been canceled in the interim
if _, ok := r.sent.Contains(c); ok {
if _, ok := r.sentAt[c]; !ok {
r.sentAt[c] = at
Expand Down Expand Up @@ -222,7 +222,7 @@ type DontHaveTimeoutManager interface {
// Shutdown the manager (Shutdown is final, manager cannot be restarted)
Shutdown()
// AddPending adds the wants as pending a response. If the are not
// cancelled before the timeout, the OnDontHaveTimeout method will be called.
// canceled before the timeout, the OnDontHaveTimeout method will be called.
AddPending([]cid.Cid)
// CancelPending removes the wants
CancelPending([]cid.Cid)
Expand Down Expand Up @@ -597,7 +597,7 @@ func (mq *MessageQueue) sendMessage() {
}
}

// If want-block times out, simulate a DONT_HAVE reponse.
// If want-block times out, simulate a DONT_HAVE response.
// This is necessary when making requests to peers running an older version of
// Bitswap that doesn't support the DONT_HAVE response, and is also useful to
// mitigate getting blocked by a peer that takes a long time to respond.
Expand Down Expand Up @@ -847,13 +847,13 @@ FINISH:
defer mq.wllock.Unlock()

for _, e := range peerEntries[:sentPeerEntries] {
if e.Cid.Defined() { // Check if want was cancelled in the interim
if e.Cid.Defined() { // Check if want was canceled in the interim
mq.peerWants.SentAt(e.Cid, now)
}
}

for _, e := range bcstEntries[:sentBcstEntries] {
if e.Cid.Defined() { // Check if want was cancelled in the interim
if e.Cid.Defined() { // Check if want was canceled in the interim
mq.bcstWants.SentAt(e.Cid, now)
}
}
Expand Down
2 changes: 1 addition & 1 deletion bitswap/server/internal/decision/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ func (e *Engine) handleOverflow(ctx context.Context, p peer.ID, overflow, wants
return wants
}

// Split the want-havek entries from the cancel and deny entries.
// Split the want, cancel, and deny entries.
func (e *Engine) splitWantsCancelsDenials(p peer.ID, m bsmsg.BitSwapMessage) ([]bsmsg.Entry, []bsmsg.Entry, []bsmsg.Entry, error) {
entries := m.Wantlist() // creates copy; safe to modify
if len(entries) == 0 {
Expand Down

0 comments on commit b66edee

Please sign in to comment.