Documentation
¶
Index ¶
- Constants
- type EndorsementIDsCache
- type EndorsementPool
- func (p *EndorsementPool) Add(e *proto.EndorseBlock, pk bls.PublicKey, lastFinalizedHeight proto.Height, ...) (bool, error)
- func (p *EndorsementPool) BlockGenerator() (crypto.PublicKey, error)
- func (p *EndorsementPool) CleanAll()
- func (p *EndorsementPool) ConflictEndorsements() []proto.EndorseBlock
- func (p *EndorsementPool) FormFinalization() (proto.FinalizationVoting, error)
- func (p *EndorsementPool) GetAll() []proto.EndorseBlock
- func (p *EndorsementPool) GetEndorsers() []bls.PublicKey
- func (p *EndorsementPool) Len() int
- func (p *EndorsementPool) SaveBlockGenerator(blockGenerator *crypto.PublicKey)
- func (p *EndorsementPool) ShouldIgnoreEndorsement(e *proto.EndorseBlock, pk bls.PublicKey, lastFinalizedHeight proto.Height, ...) bool
- func (p *EndorsementPool) Verify() (bool, error)
Constants ¶
View Source
const EndorsementIDCacheSizeDefault = 1000
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EndorsementIDsCache ¶
type EndorsementIDsCache struct {
// contains filtered or unexported fields
}
func NewEndorsementIDsCache ¶
func NewEndorsementIDsCache(cacheLimit int) *EndorsementIDsCache
func (*EndorsementIDsCache) Clear ¶
func (cache *EndorsementIDsCache) Clear()
func (*EndorsementIDsCache) RememberEndorsement ¶
func (cache *EndorsementIDsCache) RememberEndorsement(id crypto.Digest)
func (*EndorsementIDsCache) SeenEndorsement ¶
func (cache *EndorsementIDsCache) SeenEndorsement(id crypto.Digest) bool
type EndorsementPool ¶
type EndorsementPool struct {
// contains filtered or unexported fields
}
func NewEndorsementPool ¶
func NewEndorsementPool(maxGenerators int) (*EndorsementPool, error)
func (*EndorsementPool) Add ¶
func (p *EndorsementPool) Add(e *proto.EndorseBlock, pk bls.PublicKey, lastFinalizedHeight proto.Height, lastFinalizedBlockID proto.BlockID, balance uint64, parentBlockID proto.BlockID) (bool, error)
Add inserts an endorsement into the heap with priority based on balance desc, seq asc.
func (*EndorsementPool) BlockGenerator ¶
func (p *EndorsementPool) BlockGenerator() (crypto.PublicKey, error)
func (*EndorsementPool) CleanAll ¶
func (p *EndorsementPool) CleanAll()
func (*EndorsementPool) ConflictEndorsements ¶
func (p *EndorsementPool) ConflictEndorsements() []proto.EndorseBlock
func (*EndorsementPool) FormFinalization ¶
func (p *EndorsementPool) FormFinalization() (proto.FinalizationVoting, error)
func (*EndorsementPool) GetAll ¶
func (p *EndorsementPool) GetAll() []proto.EndorseBlock
func (*EndorsementPool) GetEndorsers ¶
func (p *EndorsementPool) GetEndorsers() []bls.PublicKey
func (*EndorsementPool) Len ¶
func (p *EndorsementPool) Len() int
func (*EndorsementPool) SaveBlockGenerator ¶
func (p *EndorsementPool) SaveBlockGenerator(blockGenerator *crypto.PublicKey)
func (*EndorsementPool) ShouldIgnoreEndorsement ¶
func (p *EndorsementPool) ShouldIgnoreEndorsement( e *proto.EndorseBlock, pk bls.PublicKey, lastFinalizedHeight proto.Height, parentBlockID proto.BlockID, ) bool
ShouldIgnoreEndorsement checks if the endorsement must be ignored and not added to pool/conflicts.
func (*EndorsementPool) Verify ¶
func (p *EndorsementPool) Verify() (bool, error)
Click to show internal directories.
Click to hide internal directories.