Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions consensus/istanbul/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions consensus/istanbul/backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion consensus/istanbul/ibft/core/preprepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion consensus/istanbul/ibft/core/testbackend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion core/types/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down