Skip to content

Commit 234cc8e

Browse files
authored
eth/downloader: minor typo fixes in comments (#21035)
1 parent 5cdc2df commit 234cc8e

4 files changed

Lines changed: 7 additions & 8 deletions

File tree

‎eth/downloader/downloader.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ func (d *Downloader) synchronise(id string, hash common.Hash, td *big.Int, mode
361361
log.Info("Block synchronisation started")
362362
}
363363
// If we are already full syncing, but have a fast-sync bloom filter laying
364-
// around, make sure it does't use memory any more. This is a special case
364+
// around, make sure it doesn't use memory any more. This is a special case
365365
// when the user attempts to fast sync a new empty network.
366366
if mode == FullSync && d.stateBloom != nil {
367367
d.stateBloom.Close()
@@ -665,7 +665,7 @@ func calculateRequestSpan(remoteHeight, localHeight uint64) (int64, int, int, ui
665665
requestHead = 0
666666
}
667667
// requestBottom is the lowest block we want included in the query
668-
// Ideally, we want to include just below own head
668+
// Ideally, we want to include the one just below our own head
669669
requestBottom := int(localHeight - 1)
670670
if requestBottom < 0 {
671671
requestBottom = 0

‎eth/downloader/downloader_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ func testBlockHeaderAttackerDropping(t *testing.T, protocol int) {
11261126
chain := testChainBase.shorten(1)
11271127

11281128
for i, tt := range tests {
1129-
// Register a new peer and ensure it's presence
1129+
// Register a new peer and ensure its presence
11301130
id := fmt.Sprintf("test %d", i)
11311131
if err := tester.newPeer(id, protocol, chain); err != nil {
11321132
t.Fatalf("test %d: failed to register new peer: %v", i, err)

‎eth/downloader/queue.go‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,7 @@ func (q *queue) ShouldThrottleReceipts() bool {
234234
}
235235

236236
// resultSlots calculates the number of results slots available for requests
237-
// whilst adhering to both the item and the memory limit too of the results
238-
// cache.
237+
// whilst adhering to both the item and the memory limits of the result cache.
239238
func (q *queue) resultSlots(pendPool map[string]*fetchRequest, donePool map[common.Hash]struct{}) int {
240239
// Calculate the maximum length capped by the memory limit
241240
limit := len(q.resultCache)
@@ -348,7 +347,7 @@ func (q *queue) Schedule(headers []*types.Header, from uint64) []*types.Header {
348347
}
349348

350349
// Results retrieves and permanently removes a batch of fetch results from
351-
// the cache. the result slice will be empty if the queue has been closed.
350+
// the cache. The result slice will be empty if the queue has been closed.
352351
func (q *queue) Results(block bool) []*fetchResult {
353352
q.lock.Lock()
354353
defer q.lock.Unlock()

‎trie/sync.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ func (s *Sync) Missing(max int) []common.Hash {
174174
}
175175

176176
// Process injects a batch of retrieved trie nodes data, returning if something
177-
// was committed to the database and also the index of an entry if processing of
178-
// it failed.
177+
// was committed to the database and also the index of an entry if its processing
178+
// failed.
179179
func (s *Sync) Process(results []SyncResult) (bool, int, error) {
180180
committed := false
181181

0 commit comments

Comments
 (0)