diff --git a/consensus/istanbul/backend.go b/consensus/istanbul/backend.go index ce52cf2abc..9698f4b969 100644 --- a/consensus/istanbul/backend.go +++ b/consensus/istanbul/backend.go @@ -62,8 +62,8 @@ type Backend interface { // LastProposal retrieves latest committed proposal and the address of proposer LastProposal() (Proposal, common.Address) - // HasPropsal checks if the combination of the given hash and height matches any existing blocks - HasPropsal(hash common.Hash, number *big.Int) bool + // HasProposal checks if the combination of the given hash and height matches any existing blocks + HasProposal(hash common.Hash, number *big.Int) bool // GetProposer returns the proposer of the given block height GetProposer(number uint64) common.Address diff --git a/consensus/istanbul/backend/backend.go b/consensus/istanbul/backend/backend.go index ce84ca3970..0ddef5b424 100644 --- a/consensus/istanbul/backend/backend.go +++ b/consensus/istanbul/backend/backend.go @@ -303,8 +303,8 @@ func (sb *Backend) CheckSignature(data []byte, address common.Address, sig []byt return nil } -// HasPropsal implements istanbul.Backend.HashBlock -func (sb *Backend) HasPropsal(hash common.Hash, number *big.Int) bool { +// HasProposal implements istanbul.Backend.HashBlock +func (sb *Backend) HasProposal(hash common.Hash, number *big.Int) bool { return sb.chain.GetHeader(hash, number.Uint64()) != nil } diff --git a/consensus/istanbul/ibft/core/preprepare.go b/consensus/istanbul/ibft/core/preprepare.go index 487c5abf59..36d92c1c68 100644 --- a/consensus/istanbul/ibft/core/preprepare.go +++ b/consensus/istanbul/ibft/core/preprepare.go @@ -66,7 +66,7 @@ func (c *core) handlePreprepare(msg *ibfttypes.Message, src istanbul.Validator) // Broadcast COMMIT if it is an existing block // 1. The proposer needs to be a proposer matches the given (Sequence + Round) // 2. The given block must exist - if valSet.IsProposer(src.Address()) && c.backend.HasPropsal(preprepare.Proposal.Hash(), preprepare.Proposal.Number()) { + if valSet.IsProposer(src.Address()) && c.backend.HasProposal(preprepare.Proposal.Hash(), preprepare.Proposal.Number()) { c.sendCommitForOldBlock(preprepare.View, preprepare.Proposal.Hash()) return nil } diff --git a/consensus/istanbul/ibft/core/testbackend_test.go b/consensus/istanbul/ibft/core/testbackend_test.go index d78984c1e4..a7389022e3 100644 --- a/consensus/istanbul/ibft/core/testbackend_test.go +++ b/consensus/istanbul/ibft/core/testbackend_test.go @@ -153,7 +153,7 @@ func (self *testSystemBackend) LastProposal() (istanbul.Proposal, common.Address } // Only block height 5 will return true -func (self *testSystemBackend) HasPropsal(hash common.Hash, number *big.Int) bool { +func (self *testSystemBackend) HasProposal(hash common.Hash, number *big.Int) bool { return number.Cmp(big.NewInt(5)) == 0 } diff --git a/core/types/block.go b/core/types/block.go index d613cfc57e..5e5f819cbb 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -312,7 +312,7 @@ func (b *Block) Header() *Header { return CopyHeader(b.header) } func (b *Block) Body() *Body { return &Body{b.transactions, b.uncles} } // Size returns the true RLP encoded storage size of the block, either by encoding -// and returning it, or returning a previsouly cached value. +// and returning it, or returning a previously cached value. func (b *Block) Size() common.StorageSize { if size := b.size.Load(); size != nil { return size.(common.StorageSize)