all: fix typos in comments (#21118)

This commit is contained in:
Martin Michlmayr
2020-05-25 16:21:28 +08:00
committed by GitHub
parent 48e3b95e77
commit 4f2784b38f
55 changed files with 65 additions and 65 deletions

View File

@ -724,7 +724,7 @@ func (d *Downloader) findAncestor(p *peerConnection, remoteHeader *types.Header)
// If we're doing a light sync, ensure the floor doesn't go below the CHT, as
// all headers before that point will be missing.
if d.mode == LightSync {
// If we dont know the current CHT position, find it
// If we don't know the current CHT position, find it
if d.genesis == 0 {
header := d.lightchain.CurrentHeader()
for header != nil {
@ -1182,7 +1182,7 @@ func (d *Downloader) fetchReceipts(from uint64) error {
// - capacity: network callback to retrieve the estimated type-specific bandwidth capacity of a peer (traffic shaping)
// - idle: network callback to retrieve the currently (type specific) idle peers that can be assigned tasks
// - setIdle: network callback to set a peer back to idle and update its estimated capacity (traffic shaping)
// - kind: textual label of the type being downloaded to display in log mesages
// - kind: textual label of the type being downloaded to display in log messages
func (d *Downloader) fetchParts(deliveryCh chan dataPack, deliver func(dataPack) (int, error), wakeCh chan bool,
expire func() map[string]int, pending func() int, inFlight func() bool, throttle func() bool, reserve func(*peerConnection, int) (*fetchRequest, bool, error),
fetchHook func([]*types.Header), fetch func(*peerConnection, *fetchRequest) error, cancel func(*fetchRequest), capacity func(*peerConnection) int,

View File

@ -1069,7 +1069,7 @@ func testInvalidHeaderRollback(t *testing.T, protocol int, mode SyncMode) {
}
}
// Tests that a peer advertising an high TD doesn't get to stall the downloader
// Tests that a peer advertising a high TD doesn't get to stall the downloader
// afterwards by not sending any useful hashes.
func TestHighTDStarvationAttack62(t *testing.T) { testHighTDStarvationAttack(t, 62, FullSync) }
func TestHighTDStarvationAttack63Full(t *testing.T) { testHighTDStarvationAttack(t, 63, FullSync) }

View File

@ -155,7 +155,7 @@ func (p *peerConnection) FetchHeaders(from uint64, count int) error {
}
p.headerStarted = time.Now()
// Issue the header retrieval request (absolut upwards without gaps)
// Issue the header retrieval request (absolute upwards without gaps)
go p.peer.RequestHeadersByNumber(from, count, 0, false)
return nil

View File

@ -515,7 +515,7 @@ func (f *TxFetcher) loop() {
// Schedule a new transaction retrieval
f.scheduleFetches(timeoutTimer, timeoutTrigger, nil)
// No idea if we sheduled something or not, trigger the timer if needed
// No idea if we scheduled something or not, trigger the timer if needed
// TODO(karalabe): this is kind of lame, can't we dump it into scheduleFetches somehow?
f.rescheduleTimeout(timeoutTimer, timeoutTrigger)

View File

@ -30,7 +30,7 @@ import (
)
var (
// testTxs is a set of transactions to use during testing that have meaninful hashes.
// testTxs is a set of transactions to use during testing that have meaningful hashes.
testTxs = []*types.Transaction{
types.NewTransaction(5577006791947779410, common.Address{0x0f}, new(big.Int), 0, new(big.Int), nil),
types.NewTransaction(15352856648520921629, common.Address{0xbb}, new(big.Int), 0, new(big.Int), nil),
@ -449,7 +449,7 @@ func TestTransactionFetcherCleanupEmpty(t *testing.T) {
})
}
// Tests that non-returned transactions are either re-sheduled from a
// Tests that non-returned transactions are either re-scheduled from a
// different peer, or self if they are after the cutoff point.
func TestTransactionFetcherMissingRescheduling(t *testing.T) {
testTransactionFetcherParallel(t, txFetcherTest{

View File

@ -237,7 +237,7 @@ func (cs *chainSyncer) nextSyncOp() *chainSyncOp {
return nil // Sync already running.
}
// Ensure we're at mininum peer count.
// Ensure we're at minimum peer count.
minPeers := defaultMinSyncPeers
if cs.forced {
minPeers = 1