未验证 提交 234cc8e7 编写于 作者: G Guillaume Ballet 提交者: GitHub

eth/downloader: minor typo fixes in comments (#21035)

上级 5cdc2dff
...@@ -361,7 +361,7 @@ func (d *Downloader) synchronise(id string, hash common.Hash, td *big.Int, mode ...@@ -361,7 +361,7 @@ func (d *Downloader) synchronise(id string, hash common.Hash, td *big.Int, mode
log.Info("Block synchronisation started") log.Info("Block synchronisation started")
} }
// If we are already full syncing, but have a fast-sync bloom filter laying // If we are already full syncing, but have a fast-sync bloom filter laying
// around, make sure it does't use memory any more. This is a special case // around, make sure it doesn't use memory any more. This is a special case
// when the user attempts to fast sync a new empty network. // when the user attempts to fast sync a new empty network.
if mode == FullSync && d.stateBloom != nil { if mode == FullSync && d.stateBloom != nil {
d.stateBloom.Close() d.stateBloom.Close()
...@@ -665,7 +665,7 @@ func calculateRequestSpan(remoteHeight, localHeight uint64) (int64, int, int, ui ...@@ -665,7 +665,7 @@ func calculateRequestSpan(remoteHeight, localHeight uint64) (int64, int, int, ui
requestHead = 0 requestHead = 0
} }
// requestBottom is the lowest block we want included in the query // requestBottom is the lowest block we want included in the query
// Ideally, we want to include just below own head // Ideally, we want to include the one just below our own head
requestBottom := int(localHeight - 1) requestBottom := int(localHeight - 1)
if requestBottom < 0 { if requestBottom < 0 {
requestBottom = 0 requestBottom = 0
......
...@@ -1126,7 +1126,7 @@ func testBlockHeaderAttackerDropping(t *testing.T, protocol int) { ...@@ -1126,7 +1126,7 @@ func testBlockHeaderAttackerDropping(t *testing.T, protocol int) {
chain := testChainBase.shorten(1) chain := testChainBase.shorten(1)
for i, tt := range tests { for i, tt := range tests {
// Register a new peer and ensure it's presence // Register a new peer and ensure its presence
id := fmt.Sprintf("test %d", i) id := fmt.Sprintf("test %d", i)
if err := tester.newPeer(id, protocol, chain); err != nil { if err := tester.newPeer(id, protocol, chain); err != nil {
t.Fatalf("test %d: failed to register new peer: %v", i, err) t.Fatalf("test %d: failed to register new peer: %v", i, err)
......
...@@ -234,8 +234,7 @@ func (q *queue) ShouldThrottleReceipts() bool { ...@@ -234,8 +234,7 @@ func (q *queue) ShouldThrottleReceipts() bool {
} }
// resultSlots calculates the number of results slots available for requests // resultSlots calculates the number of results slots available for requests
// whilst adhering to both the item and the memory limit too of the results // whilst adhering to both the item and the memory limits of the result cache.
// cache.
func (q *queue) resultSlots(pendPool map[string]*fetchRequest, donePool map[common.Hash]struct{}) int { func (q *queue) resultSlots(pendPool map[string]*fetchRequest, donePool map[common.Hash]struct{}) int {
// Calculate the maximum length capped by the memory limit // Calculate the maximum length capped by the memory limit
limit := len(q.resultCache) limit := len(q.resultCache)
...@@ -348,7 +347,7 @@ func (q *queue) Schedule(headers []*types.Header, from uint64) []*types.Header { ...@@ -348,7 +347,7 @@ func (q *queue) Schedule(headers []*types.Header, from uint64) []*types.Header {
} }
// Results retrieves and permanently removes a batch of fetch results from // Results retrieves and permanently removes a batch of fetch results from
// the cache. the result slice will be empty if the queue has been closed. // the cache. The result slice will be empty if the queue has been closed.
func (q *queue) Results(block bool) []*fetchResult { func (q *queue) Results(block bool) []*fetchResult {
q.lock.Lock() q.lock.Lock()
defer q.lock.Unlock() defer q.lock.Unlock()
......
...@@ -174,8 +174,8 @@ func (s *Sync) Missing(max int) []common.Hash { ...@@ -174,8 +174,8 @@ func (s *Sync) Missing(max int) []common.Hash {
} }
// Process injects a batch of retrieved trie nodes data, returning if something // Process injects a batch of retrieved trie nodes data, returning if something
// was committed to the database and also the index of an entry if processing of // was committed to the database and also the index of an entry if its processing
// it failed. // failed.
func (s *Sync) Process(results []SyncResult) (bool, int, error) { func (s *Sync) Process(results []SyncResult) (bool, int, error) {
committed := false committed := false
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册