forked from onflow/flow-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
communicator.go
24 lines (18 loc) · 873 Bytes
/
communicator.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package hotstuff
import (
"time"
"github.com/onflow/flow-go/model/flow"
)
// Communicator is the component that allows the HotStuff core algorithm to
// communicate with the other actors of the consensus process.
type Communicator interface {
// SendVote sends a vote for the given parameters to the specified recipient.
SendVote(blockID flow.Identifier, view uint64, sigData []byte, recipientID flow.Identifier) error
// BroadcastProposal broadcasts the given block proposal to all actors of
// the consensus process.
BroadcastProposal(proposal *flow.Header) error
// BroadcastProposalWithDelay broadcasts the given block proposal to all actors of
// the consensus process.
// delay is to hold the proposal before broadcasting it. Useful to control the block production rate.
BroadcastProposalWithDelay(proposal *flow.Header, delay time.Duration) error
}