diff --git a/core/blockchain.go b/core/blockchain.go index 189ae7d9c2..028212a051 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -852,7 +852,7 @@ var lastWrite uint64 // WriteBlockWithoutState writes only the block and its metadata to the database, // but does not write any state. This is used to construct competing side forks -// up to teh point where they exceed the canonical total difficulty. +// up to the point where they exceed the canonical total difficulty. func (bc *BlockChain) WriteBlockWithoutState(block *types.Block, td *big.Int) (err error) { bc.wg.Add(1) defer bc.wg.Done() @@ -866,7 +866,7 @@ func (bc *BlockChain) WriteBlockWithoutState(block *types.Block, td *big.Int) (e return nil } -// WriteBlockWithState writes the block and all assocaited state to the database. +// WriteBlockWithState writes the block and all associated state to the database. func (bc *BlockChain) WriteBlockWithState(block *types.Block, receipts []*types.Receipt, state *state.StateDB) (status WriteStatus, err error) { bc.wg.Add(1) defer bc.wg.Done() diff --git a/trie/database.go b/trie/database.go index 1b82ace7ad..fb7d5d57bd 100644 --- a/trie/database.go +++ b/trie/database.go @@ -72,7 +72,7 @@ func NewDatabase(diskdb ethdb.Database) *Database { return &Database{ diskdb: diskdb, nodes: map[common.Hash]*cachedNode{ - common.Hash{}: {children: make(map[common.Hash]int)}, + {}: {children: make(map[common.Hash]int)}, }, preimages: make(map[common.Hash][]byte), } @@ -218,7 +218,7 @@ func (db *Database) dereference(child common.Hash, parent common.Hash) { if node.children[child] == 0 { delete(node.children, child) } - // If the node does not exist, it's a previously comitted node. + // If the node does not exist, it's a previously committed node. node, ok := db.nodes[child] if !ok { return @@ -289,7 +289,7 @@ func (db *Database) Commit(node common.Hash) error { // commit is the private locked version of Commit. func (db *Database) commit(hash common.Hash, batch *ethdb.Batch) error { - // If the node does not exist, it's a previously comitted node + // If the node does not exist, it's a previously committed node node, ok := db.nodes[hash] if !ok { return nil