forked from kaspanet/kaspad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
consensus_events.go
30 lines (24 loc) · 883 Bytes
/
consensus_events.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
25
26
27
28
29
30
package externalapi
// ConsensusEvent is an interface type that is implemented by all events raised by consensus
type ConsensusEvent interface {
isConsensusEvent()
}
// BlockAdded is an event raised by consensus when a block was added to the dag
type BlockAdded struct {
Block *DomainBlock
}
func (*BlockAdded) isConsensusEvent() {}
// VirtualChangeSet is an event raised by consensus when virtual changes
type VirtualChangeSet struct {
VirtualSelectedParentChainChanges *SelectedChainPath
VirtualUTXODiff UTXODiff
VirtualParents []*DomainHash
VirtualSelectedParentBlueScore uint64
VirtualDAAScore uint64
}
func (*VirtualChangeSet) isConsensusEvent() {}
// SelectedChainPath is a path the of the selected chains between two blocks.
type SelectedChainPath struct {
Added []*DomainHash
Removed []*DomainHash
}