aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWenbiao Zheng <delweng@gmail.com>2018-05-24 20:55:20 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-05-24 20:55:20 +0800
commitd6ed2f67a8cdb07ce7b4eaea93452afb0cdbaa23 (patch)
tree6f7cc281ee2b62c00bc609936a477ba89ad7df1b
parent54294b45b10bbcdfd0cd64292cbd05d66d12ffd5 (diff)
downloadgo-tangerine-d6ed2f67a8cdb07ce7b4eaea93452afb0cdbaa23.tar
go-tangerine-d6ed2f67a8cdb07ce7b4eaea93452afb0cdbaa23.tar.gz
go-tangerine-d6ed2f67a8cdb07ce7b4eaea93452afb0cdbaa23.tar.bz2
go-tangerine-d6ed2f67a8cdb07ce7b4eaea93452afb0cdbaa23.tar.lz
go-tangerine-d6ed2f67a8cdb07ce7b4eaea93452afb0cdbaa23.tar.xz
go-tangerine-d6ed2f67a8cdb07ce7b4eaea93452afb0cdbaa23.tar.zst
go-tangerine-d6ed2f67a8cdb07ce7b4eaea93452afb0cdbaa23.zip
eth, node, trie: fix minor typos (#16802)
-rw-r--r--eth/backend.go10
-rw-r--r--node/doc.go4
-rw-r--r--trie/trie.go2
3 files changed, 8 insertions, 8 deletions
diff --git a/eth/backend.go b/eth/backend.go
index ea70e3826..e07d5efc9 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -215,14 +215,14 @@ func CreateConsensusEngine(ctx *node.ServiceContext, config *ethash.Config, chai
return clique.New(chainConfig.Clique, db)
}
// Otherwise assume proof-of-work
- switch {
- case config.PowMode == ethash.ModeFake:
+ switch config.PowMode {
+ case ethash.ModeFake:
log.Warn("Ethash used in fake mode")
return ethash.NewFaker()
- case config.PowMode == ethash.ModeTest:
+ case ethash.ModeTest:
log.Warn("Ethash used in test mode")
return ethash.NewTester()
- case config.PowMode == ethash.ModeShared:
+ case ethash.ModeShared:
log.Warn("Ethash used in shared mode")
return ethash.NewShared()
default:
@@ -239,7 +239,7 @@ func CreateConsensusEngine(ctx *node.ServiceContext, config *ethash.Config, chai
}
}
-// APIs returns the collection of RPC services the ethereum package offers.
+// APIs return the collection of RPC services the ethereum package offers.
// NOTE, some of these services probably need to be moved to somewhere else.
func (s *Ethereum) APIs() []rpc.API {
apis := ethapi.GetAPIs(s.APIBackend)
diff --git a/node/doc.go b/node/doc.go
index d9688e0a1..41a88c19a 100644
--- a/node/doc.go
+++ b/node/doc.go
@@ -59,7 +59,7 @@ using the same data directory will store this information in different subdirect
the data directory.
LevelDB databases are also stored within the instance subdirectory. If multiple node
-instances use the same data directory, openening the databases with identical names will
+instances use the same data directory, opening the databases with identical names will
create one database for each instance.
The account key store is shared among all node instances using the same data directory
@@ -84,7 +84,7 @@ directory. Mode instance A opens the database "db", node instance B opens the da
static-nodes.json -- devp2p static node list of instance B
db/ -- LevelDB content for "db"
db-2/ -- LevelDB content for "db-2"
- B.ipc -- JSON-RPC UNIX domain socket endpoint of instance A
+ B.ipc -- JSON-RPC UNIX domain socket endpoint of instance B
keystore/ -- account key store, used by both instances
*/
package node
diff --git a/trie/trie.go b/trie/trie.go
index 31a404e3a..30543c549 100644
--- a/trie/trie.go
+++ b/trie/trie.go
@@ -101,7 +101,7 @@ func New(root common.Hash, db *Database) (*Trie, error) {
db: db,
originalRoot: root,
}
- if (root != common.Hash{}) && root != emptyRoot {
+ if root != (common.Hash{}) && root != emptyRoot {
rootnode, err := trie.resolveHash(root[:], nil)
if err != nil {
return nil, err