Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Validate ¶ added in v0.3.0
Validate complies with the republisher.Validator interface. It internally invokes ValidateCandidate
func ValidateCandidate ¶ added in v0.3.0
ValidateCandidate makes sure the hash and root are correct, to avoid malicious nodes from // overwriting the candidate block for a specific hash
Types ¶
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
Broker is the entry point for the candidate component. It manages an in-memory store of `Candidate` messages, and allows for the fetching of these messages through the `RPCBus`. It listens for incoming `Candidate` messages and puts them on the store. In case an internal component requests an absent `Candidate` message, the Broker can make a `GetCandidate` request to the rest of the network, and will attempt to provide the requesting component with it's needed `Candidate`.
func NewBroker ¶
NewBroker returns an initialized Broker struct. It will still need to be started by calling `Listen`.
func (*Broker) AddValidHash ¶ added in v0.3.0
AddValidHash to the local cache for a score. Broker.validHashes uses a map to implement a HashSet
func (Broker) Clear ¶
Clear removes all candidate messages from or before a given round. Returns the amount of messages deleted.