diff options
author | S. Matthew English <s-matthew-english@users.noreply.github.com> | 2017-06-12 20:45:17 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2017-06-12 20:45:17 +0800 |
commit | 061889d4ea13b23d777efbe005210ead8667e869 (patch) | |
tree | 35a391e5ac09e683796c3c698f36542f06803d03 /consensus/clique | |
parent | e3dfd5582026a8744a80d3de407601526b720abb (diff) | |
download | dexon-061889d4ea13b23d777efbe005210ead8667e869.tar dexon-061889d4ea13b23d777efbe005210ead8667e869.tar.gz dexon-061889d4ea13b23d777efbe005210ead8667e869.tar.bz2 dexon-061889d4ea13b23d777efbe005210ead8667e869.tar.lz dexon-061889d4ea13b23d777efbe005210ead8667e869.tar.xz dexon-061889d4ea13b23d777efbe005210ead8667e869.tar.zst dexon-061889d4ea13b23d777efbe005210ead8667e869.zip |
rlp, trie, contracts, compression, consensus: improve comments (#14580)
Diffstat (limited to 'consensus/clique')
-rw-r--r-- | consensus/clique/clique.go | 12 | ||||
-rw-r--r-- | consensus/clique/snapshot.go | 4 | ||||
-rw-r--r-- | consensus/clique/snapshot_test.go | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go index 87a983377..5a50b2eb4 100644 --- a/consensus/clique/clique.go +++ b/consensus/clique/clique.go @@ -76,7 +76,7 @@ var ( errUnknownBlock = errors.New("unknown block") // errInvalidCheckpointBeneficiary is returned if a checkpoint/epoch transition - // block has a beneficiary set to non zeroes. + // block has a beneficiary set to non-zeroes. errInvalidCheckpointBeneficiary = errors.New("beneficiary in checkpoint block non-zero") // errInvalidVote is returned if a nonce value is something else that the two @@ -84,7 +84,7 @@ var ( errInvalidVote = errors.New("vote nonce not 0x00..0 or 0xff..f") // errInvalidCheckpointVote is returned if a checkpoint/epoch transition block - // has a vote nonce set to non zeroes. + // has a vote nonce set to non-zeroes. errInvalidCheckpointVote = errors.New("vote nonce in checkpoint block non-zero") // errMissingVanity is returned if a block's extra-data section is shorter than @@ -104,7 +104,7 @@ var ( // ones). drrInvalidCheckpointSigners = errors.New("invalid signer list on checkpoint block") - // errInvalidMixDigest is returned if a block's mix digest is non zero. + // errInvalidMixDigest is returned if a block's mix digest is non-zero. errInvalidMixDigest = errors.New("non-zero mix digest") // errInvalidUncleHash is returned if a block contains an non-empty uncle list. @@ -122,7 +122,7 @@ var ( // be modified via out-of-range or non-contiguous headers. errInvalidVotingChain = errors.New("invalid voting chain") - // errUnauthorized is returned if a header is signed by a non authorized entity. + // errUnauthorized is returned if a header is signed by a non-authorized entity. errUnauthorized = errors.New("unauthorized") ) @@ -499,7 +499,7 @@ func (c *Clique) verifySeal(chain consensus.ChainReader, header *types.Header, p // Prepare implements consensus.Engine, preparing all the consensus fields of the // header for running the transactions on top. func (c *Clique) Prepare(chain consensus.ChainReader, header *types.Header) error { - // If the block isn't a checkpoint, cast a random vote (good enough fror now) + // If the block isn't a checkpoint, cast a random vote (good enough for now) header.Coinbase = common.Address{} header.Nonce = types.BlockNonce{} @@ -601,7 +601,7 @@ func (c *Clique) Seal(chain consensus.ChainReader, block *types.Block, stop <-ch if _, authorized := snap.Signers[signer]; !authorized { return nil, errUnauthorized } - // If we're amongs the recent signers, wait for the next block + // If we're amongst the recent signers, wait for the next block for seen, recent := range snap.Recents { if recent == signer { // Signer is among recents, only wait if the current block doens't shift it out diff --git a/consensus/clique/snapshot.go b/consensus/clique/snapshot.go index fb86bc5e6..8eaf3b62e 100644 --- a/consensus/clique/snapshot.go +++ b/consensus/clique/snapshot.go @@ -39,7 +39,7 @@ type Vote struct { // Tally is a simple vote tally to keep the current score of votes. Votes that // go against the proposal aren't counted since it's equivalent to not voting. type Tally struct { - Authorize bool `json:"authorize"` // Whether the vote it about authorizing or kicking someone + Authorize bool `json:"authorize"` // Whether the vote is about authorizing or kicking someone Votes int `json:"votes"` // Number of votes until now wanting to pass the proposal } @@ -56,7 +56,7 @@ type Snapshot struct { Tally map[common.Address]Tally `json:"tally"` // Current vote tally to avoid recalculating } -// newSnapshot create a new snapshot with the specified startup parameters. This +// newSnapshot creates a new snapshot with the specified startup parameters. This // method does not initialize the set of recent signers, so only ever use if for // the genesis block. func newSnapshot(config *params.CliqueConfig, sigcache *lru.ARCCache, number uint64, hash common.Hash, signers []common.Address) *Snapshot { diff --git a/consensus/clique/snapshot_test.go b/consensus/clique/snapshot_test.go index 49a1d7d5b..f18934b89 100644 --- a/consensus/clique/snapshot_test.go +++ b/consensus/clique/snapshot_test.go @@ -243,7 +243,7 @@ func TestVoting(t *testing.T) { }, results: []string{"A", "B"}, }, { - // Cascading changes are not allowed, only the the account being voted on may change + // Cascading changes are not allowed, only the account being voted on may change signers: []string{"A", "B", "C", "D"}, votes: []testerVote{ {signer: "A", voted: "C", auth: false}, @@ -293,7 +293,7 @@ func TestVoting(t *testing.T) { results: []string{"A", "B", "C"}, }, { // Ensure that pending votes don't survive authorization status changes. This - // corner case can only appear if a signer is quickly added, remove and then + // corner case can only appear if a signer is quickly added, removed and then // readded (or the inverse), while one of the original voters dropped. If a // past vote is left cached in the system somewhere, this will interfere with // the final signer outcome. |