Skip to content

Commit c9bf298

Browse files
committed
fix whitespace
1 parent 3839bf7 commit c9bf298

File tree

2 files changed

+28
-25
lines changed

2 files changed

+28
-25
lines changed

eth/downloader/downloader.go

+22-20
Original file line numberDiff line numberDiff line change
@@ -702,9 +702,11 @@ func (d *Downloader) fetchHead(p *peerConnection) (head *types.Header, pivot *ty
702702
// calculateRequestSpan calculates what headers to request from a peer when trying to determine the
703703
// common ancestor.
704704
// It returns parameters to be used for peer.RequestHeadersByNumber:
705-
// from - starting block number
706-
// count - number of headers to request
707-
// skip - number of headers to skip
705+
//
706+
// from - starting block number
707+
// count - number of headers to request
708+
// skip - number of headers to skip
709+
//
708710
// and also returns 'max', the last block which is expected to be returned by the remote peers,
709711
// given the (from,count,skip)
710712
func calculateRequestSpan(remoteHeight, localHeight uint64) (int64, int, int, uint64) {
@@ -1319,22 +1321,22 @@ func (d *Downloader) fetchReceipts(from uint64) error {
13191321
// various callbacks to handle the slight differences between processing them.
13201322
//
13211323
// The instrumentation parameters:
1322-
// - errCancel: error type to return if the fetch operation is cancelled (mostly makes logging nicer)
1323-
// - deliveryCh: channel from which to retrieve downloaded data packets (merged from all concurrent peers)
1324-
// - deliver: processing callback to deliver data packets into type specific download queues (usually within `queue`)
1325-
// - wakeCh: notification channel for waking the fetcher when new tasks are available (or sync completed)
1326-
// - expire: task callback method to abort requests that took too long and return the faulty peers (traffic shaping)
1327-
// - pending: task callback for the number of requests still needing download (detect completion/non-completability)
1328-
// - inFlight: task callback for the number of in-progress requests (wait for all active downloads to finish)
1329-
// - throttle: task callback to check if the processing queue is full and activate throttling (bound memory use)
1330-
// - reserve: task callback to reserve new download tasks to a particular peer (also signals partial completions)
1331-
// - fetchHook: tester callback to notify of new tasks being initiated (allows testing the scheduling logic)
1332-
// - fetch: network callback to actually send a particular download request to a physical remote peer
1333-
// - cancel: task callback to abort an in-flight download request and allow rescheduling it (in case of lost peer)
1334-
// - capacity: network callback to retrieve the estimated type-specific bandwidth capacity of a peer (traffic shaping)
1335-
// - idle: network callback to retrieve the currently (type specific) idle peers that can be assigned tasks
1336-
// - setIdle: network callback to set a peer back to idle and update its estimated capacity (traffic shaping)
1337-
// - kind: textual label of the type being downloaded to display in log messages
1324+
// - errCancel: error type to return if the fetch operation is cancelled (mostly makes logging nicer)
1325+
// - deliveryCh: channel from which to retrieve downloaded data packets (merged from all concurrent peers)
1326+
// - deliver: processing callback to deliver data packets into type specific download queues (usually within `queue`)
1327+
// - wakeCh: notification channel for waking the fetcher when new tasks are available (or sync completed)
1328+
// - expire: task callback method to abort requests that took too long and return the faulty peers (traffic shaping)
1329+
// - pending: task callback for the number of requests still needing download (detect completion/non-completability)
1330+
// - inFlight: task callback for the number of in-progress requests (wait for all active downloads to finish)
1331+
// - throttle: task callback to check if the processing queue is full and activate throttling (bound memory use)
1332+
// - reserve: task callback to reserve new download tasks to a particular peer (also signals partial completions)
1333+
// - fetchHook: tester callback to notify of new tasks being initiated (allows testing the scheduling logic)
1334+
// - fetch: network callback to actually send a particular download request to a physical remote peer
1335+
// - cancel: task callback to abort an in-flight download request and allow rescheduling it (in case of lost peer)
1336+
// - capacity: network callback to retrieve the estimated type-specific bandwidth capacity of a peer (traffic shaping)
1337+
// - idle: network callback to retrieve the currently (type specific) idle peers that can be assigned tasks
1338+
// - setIdle: network callback to set a peer back to idle and update its estimated capacity (traffic shaping)
1339+
// - kind: textual label of the type being downloaded to display in log messages
13381340
func (d *Downloader) fetchParts(deliveryCh chan dataPack, deliver func(dataPack) (int, error), wakeCh chan bool,
13391341
expire func() map[string]int, pending func() int, inFlight func() bool, reserve func(*peerConnection, int) (*fetchRequest, bool, bool),
13401342
fetchHook func([]*types.Header), fetch func(*peerConnection, *fetchRequest) error, cancel func(*fetchRequest), capacity func(*peerConnection) int,
@@ -2008,4 +2010,4 @@ func (d *Downloader) deliver(destCh chan dataPack, packet dataPack, inMeter, dro
20082010
case <-cancel:
20092011
return errNoSyncActive
20102012
}
2011-
}
2013+
}

eth/downloader/resultstore.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,11 @@ func (r *resultStore) SetThrottleThreshold(threshold uint64) uint64 {
7171
// wants to reserve headers for fetching.
7272
//
7373
// It returns the following:
74-
// stale - if true, this item is already passed, and should not be requested again
75-
// throttled - if true, the store is at capacity, this particular header is not prio now
76-
// item - the result to store data into
77-
// err - any error that occurred
74+
//
75+
// stale - if true, this item is already passed, and should not be requested again
76+
// throttled - if true, the store is at capacity, this particular header is not prio now
77+
// item - the result to store data into
78+
// err - any error that occurred
7879
func (r *resultStore) AddFetch(header *types.Header, fastSync bool) (stale, throttled bool, item *fetchResult, err error) {
7980
r.lock.Lock()
8081
defer r.lock.Unlock()
@@ -191,4 +192,4 @@ func (r *resultStore) Prepare(offset uint64) {
191192
if r.resultOffset < offset {
192193
r.resultOffset = offset
193194
}
194-
}
195+
}

0 commit comments

Comments
 (0)