aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorHaoping Ku <haoping.ku@dexon.org>2018-07-17 17:35:18 +0800
committerWei-Ning Huang <w@dexon.org>2018-07-17 17:35:18 +0800
commit434c497f83c208b48c97d396513aa5deb5916b5a (patch)
tree6ffb51e635b82f9b3864c7f40ceb050017cfa292 /core
parentaed24cf020bd11c3b20a7011b96c02e41894fa32 (diff)
downloaddexon-consensus-434c497f83c208b48c97d396513aa5deb5916b5a.tar
dexon-consensus-434c497f83c208b48c97d396513aa5deb5916b5a.tar.gz
dexon-consensus-434c497f83c208b48c97d396513aa5deb5916b5a.tar.bz2
dexon-consensus-434c497f83c208b48c97d396513aa5deb5916b5a.tar.lz
dexon-consensus-434c497f83c208b48c97d396513aa5deb5916b5a.tar.xz
dexon-consensus-434c497f83c208b48c97d396513aa5deb5916b5a.tar.zst
dexon-consensus-434c497f83c208b48c97d396513aa5deb5916b5a.zip
Fix typos and add .gitignore (#2)
* Fix typos and add .gitignore * Add more rule on .gitignore
Diffstat (limited to 'core')
-rw-r--r--core/blockchain.go2
-rw-r--r--core/blocklattice.go4
-rw-r--r--core/network.go2
-rw-r--r--core/types/block.go2
4 files changed, 5 insertions, 5 deletions
diff --git a/core/blockchain.go b/core/blockchain.go
index 6da74af..1222516 100644
--- a/core/blockchain.go
+++ b/core/blockchain.go
@@ -19,7 +19,7 @@ package core
import "github.com/dexon-foundation/dexon-consensus-core/core/types"
-// BlockChain is the basic datastucture used for storing blocks in each
+// BlockChain is the basic datastructure used for storing blocks in each
// validator.
type BlockChain struct {
validatorID types.ValidatorID
diff --git a/core/blocklattice.go b/core/blocklattice.go
index 2f95733..10f4b51 100644
--- a/core/blocklattice.go
+++ b/core/blocklattice.go
@@ -38,7 +38,7 @@ const (
infinity uint64 = math.MaxUint64
)
-// BlockLattice represent the local view of a single validator.
+// BlockLattice represents the local view of a single validator.
//
// blockDB stores blocks that are final. blocks stores blocks that are in ToTo
// State.
@@ -97,7 +97,7 @@ func (l *BlockLattice) AddValidator(
id types.ValidatorID, genesis *types.Block) {
l.validatorSet[id] = struct{}{}
- l.fmax = len(l.validatorSet) / 3
+ l.fmax = (len(l.validatorSet) - 1) / 3
l.phi = 2*l.fmax + 1
genesis.State = types.BlockStatusFinal
diff --git a/core/network.go b/core/network.go
index 1bd714d..8de73d2 100644
--- a/core/network.go
+++ b/core/network.go
@@ -21,7 +21,7 @@ import (
"github.com/dexon-foundation/dexon-consensus-core/core/types"
)
-// Endpoint is the interface for a client network endoint.
+// Endpoint is the interface for a client network endpoint.
type Endpoint interface {
GetID() types.ValidatorID
}
diff --git a/core/types/block.go b/core/types/block.go
index 265d32f..8808312 100644
--- a/core/types/block.go
+++ b/core/types/block.go
@@ -25,7 +25,7 @@ import (
"github.com/dexon-foundation/dexon-consensus-core/common"
)
-// State represent the block process state.
+// State represents the block process state.
type State int
// Block Status.