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

@ -1074,7 +1074,7 @@ func (bc *BlockChain) InsertReceiptChain(blockChain types.Blocks, receiptChain [
size = 0
)
// updateHead updates the head fast sync block if the inserted blocks are better
// and returns a indicator whether the inserted blocks are canonical.
// and returns an indicator whether the inserted blocks are canonical.
updateHead := func(head *types.Block) bool {
bc.chainmu.Lock()

View File

@ -1410,7 +1410,7 @@ func TestEIP161AccountRemoval(t *testing.T) {
t.Error("account should not exist")
}
// account musn't be created post eip 161
// account mustn't be created post eip 161
if _, err := blockchain.InsertChain(types.Blocks{blocks[2]}); err != nil {
t.Fatal(err)
}

View File

@ -29,7 +29,7 @@ var (
ErrNoGenesis = errors.New("genesis not found in chain")
)
// List of evm-call-message pre-checking errors. All state transtion messages will
// List of evm-call-message pre-checking errors. All state transition messages will
// be pre-checked before execution. If any invalidation detected, the corresponding
// error should be returned which is defined here.
//

View File

@ -125,7 +125,7 @@ func iterateTransactions(db ethdb.Database, from uint64, to uint64, reverse bool
}
}
}
// process runs in parallell
// process runs in parallel
nThreadsAlive := int32(threads)
process := func() {
defer func() {

View File

@ -425,7 +425,7 @@ func (dl *diffLayer) Update(blockRoot common.Hash, destructs map[common.Hash]str
// flatten pushes all data from this point downwards, flattening everything into
// a single diff at the bottom. Since usually the lowermost diff is the largest,
// the flattening bulds up from there in reverse.
// the flattening builds up from there in reverse.
func (dl *diffLayer) flatten() snapshot {
// If the parent is not diff, we're the first in line, return unmodified
parent, ok := dl.parent.(*diffLayer)

View File

@ -26,7 +26,7 @@ import (
"github.com/ethereum/go-ethereum/ethdb"
)
// Iterator is a iterator to step over all the accounts or the specific
// Iterator is an iterator to step over all the accounts or the specific
// storage in a snapshot which may or may not be composed of multiple layers.
type Iterator interface {
// Next steps the iterator forward one element, returning false if exhausted,
@ -47,7 +47,7 @@ type Iterator interface {
Release()
}
// AccountIterator is a iterator to step over all the accounts in a snapshot,
// AccountIterator is an iterator to step over all the accounts in a snapshot,
// which may or may not be composed of multiple layers.
type AccountIterator interface {
Iterator
@ -57,7 +57,7 @@ type AccountIterator interface {
Account() []byte
}
// StorageIterator is a iterator to step over the specific storage in a snapshot,
// StorageIterator is an iterator to step over the specific storage in a snapshot,
// which may or may not be composed of multiple layers.
type StorageIterator interface {
Iterator
@ -250,7 +250,7 @@ type diffStorageIterator struct {
func (dl *diffLayer) StorageIterator(account common.Hash, seek common.Hash) (StorageIterator, bool) {
// Create the storage for this account even it's marked
// as destructed. The iterator is for the new one which
// just has the same adddress as the deleted one.
// just has the same address as the deleted one.
hashes, destructed := dl.StorageList(account)
index := sort.Search(len(hashes), func(i int) bool {
return bytes.Compare(seek[:], hashes[i][:]) <= 0

View File

@ -238,7 +238,7 @@ func (fi *fastIterator) next(idx int) bool {
fi.iterators = append(fi.iterators[:idx], fi.iterators[idx+1:]...)
return len(fi.iterators) > 0
}
// If there's noone left to cascade into, return
// If there's no one left to cascade into, return
if idx == len(fi.iterators)-1 {
return true
}

View File

@ -330,7 +330,7 @@ func (t *Tree) Cap(root common.Hash, layers int) error {
remove(root)
}
}
// If the disk layer was modified, regenerate all the cummulative blooms
// If the disk layer was modified, regenerate all the cumulative blooms
if persisted != nil {
var rebloom func(root common.Hash)
rebloom = func(root common.Hash) {

View File

@ -94,7 +94,7 @@ func wipeKeyRange(db ethdb.KeyValueStore, kind string, prefix []byte, keylen int
it := db.NewIterator(prefix, nil)
for it.Next() {
// Skip any keys with the correct prefix but wrong lenth (trie nodes)
// Skip any keys with the correct prefix but wrong length (trie nodes)
key := it.Key()
if !bytes.HasPrefix(key, prefix) {
break

View File

@ -71,7 +71,7 @@ var (
// maximum allowance of the current block.
ErrGasLimit = errors.New("exceeds block gas limit")
// ErrNegativeValue is a sanity error to ensure noone is able to specify a
// ErrNegativeValue is a sanity error to ensure no one is able to specify a
// transaction with a negative value.
ErrNegativeValue = errors.New("negative value")

View File

@ -465,7 +465,7 @@ var (
)
func (c *blake2F) Run(input []byte) ([]byte, error) {
// Make sure the input is valid (correct lenth and final flag)
// Make sure the input is valid (correct length and final flag)
if len(input) != blake2FInputLength {
return nil, errBlake2FInvalidInputLength
}

View File

@ -39,7 +39,7 @@ func callGas(isEip150 bool, availableGas, base uint64, callCost *big.Int) (uint6
availableGas = availableGas - base
gas := availableGas - availableGas/64
// If the bit length exceeds 64 bit we know that the newly calculated "gas" for EIP150
// is smaller than the requested amount. Therefor we return the new gas instead
// is smaller than the requested amount. Therefore we return the new gas instead
// of returning an error.
if !callCost.IsUint64() || gas < callCost.Uint64() {
return gas, nil