kaspad/domain/consensus/model/externalapi/virtualchangeset.go
Michael Sutton 016ddfdfce
Use a channel for utxo change events (#2052)
* Use a channel from within consensus in order to raise change events in order -- note that this is only a draft commit for discussion

* Fix compilation

* Check for nil

* Allow nil virtualChangeChan

* Remove redundant comments

* Call notifyVirtualChange instead of notifyUTXOsChanged

* Remove redundant comment

* Add a separate function for initVirtualChangeHandler

* Remove redundant type

* Check for nil in the right place

* Fix integration test

* Add data to virtual changeset and cleanup block added event logic

* Renames

* Comment

Co-authored-by: Ori Newman <orinewman1@gmail.com>
2022-05-19 14:07:48 +03:00

17 lines
538 B
Go

package externalapi
// VirtualChangeSet is auxiliary data returned from ValidateAndInsertBlock and ResolveVirtual
type VirtualChangeSet struct {
VirtualSelectedParentChainChanges *SelectedChainPath
VirtualUTXODiff UTXODiff
VirtualParents []*DomainHash
VirtualSelectedParentBlueScore uint64
VirtualDAAScore uint64
}
// SelectedChainPath is a path the of the selected chains between two blocks.
type SelectedChainPath struct {
Added []*DomainHash
Removed []*DomainHash
}