mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-11-27 15:53:57 +00:00
39 lines
1.1 KiB
Go
39 lines
1.1 KiB
Go
package externalapi
|
|
|
|
// ConsensusEvent is an interface type that is implemented by all events raised by consensus
|
|
type ConsensusEvent interface {
|
|
isConsensusEvent()
|
|
}
|
|
|
|
// PruningPointChange is an event raised by consensus when a new pruning point was added to the dag
|
|
type PruningPointChange struct {
|
|
OldPruningPoint *DomainHash
|
|
NewPruningPoint *DomainHash
|
|
}
|
|
|
|
func (*PruningPointChange) 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
|
|
}
|