cache

package
v1.28.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalCacheItem

type LocalCacheItem struct {
	Msg  *message.TaskMessage
	Hash string
	Lock *sync.Mutex
	// parytyID.id -> msgHash
	ConfirmedList map[string]string
}

LocalCacheItem used to cache the unconfirmed broadcast message

func NewLocalCacheItem

func NewLocalCacheItem(msg *message.TaskMessage, hash string) *LocalCacheItem

func (*LocalCacheItem) GetPeers

func (l *LocalCacheItem) GetPeers() []string

func (*LocalCacheItem) TotalConfirmParty

func (l *LocalCacheItem) TotalConfirmParty() int

TotalConfirmParty counts the number of parties that already confirmed their hash

func (*LocalCacheItem) UpdateConfirmList

func (l *LocalCacheItem) UpdateConfirmList(partyID, hash string)

UpdateConfirmList add the given party's hash into the confirm list

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL