Skip to content

Commit b7bb2d8

Browse files
committed
core: various typos
1 parent e189fb8 commit b7bb2d8

21 files changed

+39
-39
lines changed

core/block_validator.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func NewBlockValidator(blockchain *BlockChain, pow pow.PoW) *BlockValidator {
5858
// the block header's transaction and uncle roots.
5959
//
6060
// ValidateBlock does not validate the header's pow. The pow work validated
61-
// seperately so we can process them in paralel.
61+
// separately so we can process them in parallel.
6262
//
6363
// ValidateBlock also validates and makes sure that any previous state (or present)
6464
// state that might or might not be present is checked to make sure that fast
@@ -106,7 +106,7 @@ func (v *BlockValidator) ValidateBlock(block *types.Block) error {
106106

107107
// ValidateState validates the various changes that happen after a state
108108
// transition, such as amount of used gas, the receipt roots and the state root
109-
// itself. ValidateState returns a database batch if the validation was a succes
109+
// itself. ValidateState returns a database batch if the validation was a success
110110
// otherwise nil and an error is returned.
111111
func (v *BlockValidator) ValidateState(block, parent *types.Block, statedb *state.StateDB, receipts types.Receipts, usedGas *big.Int) (err error) {
112112
header := block.Header()
@@ -297,7 +297,7 @@ func calcDifficultyHomestead(time, parentTime uint64, parentNumber, parentDiff *
297297
periodCount := new(big.Int).Add(parentNumber, common.Big1)
298298
periodCount.Div(periodCount, ExpDiffPeriod)
299299

300-
// the exponential factor, commonly refered to as "the bomb"
300+
// the exponential factor, commonly referred to as "the bomb"
301301
// diff = diff + 2^(periodCount - 2)
302302
if periodCount.Cmp(common.Big1) > 0 {
303303
y.Sub(periodCount, common.Big2)

core/blockchain_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ func testBadHashes(t *testing.T, full bool) {
578578
}
579579
}
580580

581-
// Tests that bad hashes are detected on boot, and the chan rolled back to a
581+
// Tests that bad hashes are detected on boot, and the chain rolled back to a
582582
// good state prior to the bad hash.
583583
func TestReorgBadHeaderHashes(t *testing.T) { testReorgBadHashes(t, false) }
584584
func TestReorgBadBlockHashes(t *testing.T) { testReorgBadHashes(t, true) }
@@ -589,7 +589,7 @@ func testReorgBadHashes(t *testing.T, full bool) {
589589
genesis, _ := WriteTestNetGenesisBlock(db)
590590
bc := chm(genesis, db)
591591

592-
// Create a chain, import and ban aferwards
592+
// Create a chain, import and ban afterwards
593593
headers := makeHeaderChainWithDiff(genesis, []int{1, 2, 3, 4}, 10)
594594
blocks := makeBlockChainWithDiff(genesis, []int{1, 2, 3, 4}, 10)
595595

@@ -889,7 +889,7 @@ func TestChainTxReorgs(t *testing.T) {
889889
var pastDrop, freshDrop *types.Transaction
890890

891891
// Create three transactions that will be added in the forked chain:
892-
// - pastAdd: transaction added before the reorganiztion is detected
892+
// - pastAdd: transaction added before the reorganization is detected
893893
// - freshAdd: transaction added at the exact block the reorg is detected
894894
// - futureAdd: transaction added after the reorg has already finished
895895
var pastAdd, freshAdd, futureAdd *types.Transaction
@@ -1086,7 +1086,7 @@ done:
10861086
// make sure no more events are fired
10871087
select {
10881088
case e := <-subs.Chan():
1089-
t.Errorf("unexectped event fired: %v", e)
1089+
t.Errorf("unexpected event fired: %v", e)
10901090
case <-time.After(250 * time.Millisecond):
10911091
}
10921092

core/chain_makers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func (b *BlockGen) Number() *big.Int {
108108
// backing transaction.
109109
//
110110
// AddUncheckedReceipts will cause consensus failures when used during real
111-
// chain processing. This is best used in conjuction with raw block insertion.
111+
// chain processing. This is best used in conjunction with raw block insertion.
112112
func (b *BlockGen) AddUncheckedReceipt(receipt *types.Receipt) {
113113
b.receipts = append(b.receipts, receipt)
114114
}
@@ -215,7 +215,7 @@ func makeHeader(parent *types.Block, state *state.StateDB) *types.Header {
215215
// chain. Depending on the full flag, if creates either a full block chain or a
216216
// header only chain.
217217
func newCanonical(n int, full bool) (ethdb.Database, *BlockChain, error) {
218-
// Create te new chain database
218+
// Create the new chain database
219219
db, _ := ethdb.NewMemDatabase()
220220
evmux := &event.TypeMux{}
221221

core/state/managed_state.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func (ms *ManagedState) NewNonce(addr common.Address) uint64 {
8282
return uint64(len(account.nonces)-1) + account.nstart
8383
}
8484

85-
// GetNonce returns the canonical nonce for the managed or unmanged account
85+
// GetNonce returns the canonical nonce for the managed or unmanaged account
8686
func (ms *ManagedState) GetNonce(addr common.Address) uint64 {
8787
ms.mu.RLock()
8888
defer ms.mu.RUnlock()

core/state/state_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func (s *StateSuite) TestSnapshot(c *checker.C) {
102102
data1 := common.BytesToHash([]byte{42})
103103
data2 := common.BytesToHash([]byte{43})
104104

105-
// set inital state object value
105+
// set initial state object value
106106
s.state.SetState(stateobjaddr, storageaddr, data1)
107107
// get snapshot of current state
108108
snapshot := s.state.Copy()

core/state_processor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB) (ty
5555
return receipts, allLogs, totalUsedGas, err
5656
}
5757

58-
// ApplyTransaction attemps to apply a transaction to the given state database
58+
// ApplyTransaction attempts to apply a transaction to the given state database
5959
// and uses the input parameters for its environment.
6060
//
6161
// ApplyTransactions returns the generated receipts and vm logs during the

core/tx_pool.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ type stateFn func() (*state.StateDB, error)
6060
// current state) and future transactions. Transactions move between those
6161
// two states over time as they are received and processed.
6262
type TxPool struct {
63-
quit chan bool // Quiting channel
64-
currentState stateFn // The state function which will allow us to do some pre checkes
63+
quit chan bool // Quitting channel
64+
currentState stateFn // The state function which will allow us to do some pre checks
6565
pendingState *state.ManagedState
6666
gasLimit func() *big.Int // The current gas limit function callback
6767
minGasPrice *big.Int
@@ -357,7 +357,7 @@ func (self *TxPool) AddTransactions(txs []*types.Transaction) {
357357
}
358358
}
359359

360-
// check and validate the queueue
360+
// check and validate the queue
361361
self.checkQueue()
362362
}
363363

core/tx_pool_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ func TestTransactionDropping(t *testing.T) {
331331

332332
// Tests that if a transaction is dropped from the current pending pool (e.g. out
333333
// of fund), all consecutive (still valid, but not executable) transactions are
334-
// postponed back into the future queue to prevent broadcating them.
334+
// postponed back into the future queue to prevent broadcasting them.
335335
func TestTransactionPostponing(t *testing.T) {
336336
// Create a test account and fund it
337337
pool, key := setupTxPool()

core/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import (
3939
// if it failed to do so.
4040
//
4141
// ValidateState validates the given statedb and optionally the receipts and
42-
// gas used. The implementor should decide what to do with the given input.
42+
// gas used. The implementer should decide what to do with the given input.
4343
type Validator interface {
4444
HeaderValidator
4545
ValidateBlock(block *types.Block) error

core/types/block.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import (
3434
)
3535

3636
// A BlockNonce is a 64-bit hash which proves (combined with the
37-
// mix-hash) that a suffcient amount of computation has been carried
37+
// mix-hash) that a sufficient amount of computation has been carried
3838
// out on a block.
3939
type BlockNonce [8]byte
4040

0 commit comments

Comments
 (0)