mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-05 21:56:50 +00:00

* Add VirtualUTXODiff and VirtualParents to block insertion result * Add GetVirtualUTXOs * Add OnPruningPointUTXOSetOverrideHandler * Add recovery to UTXO index * Add UTXO set override notification * Fix compilation error * Fix iterators in UTXO index and fix TestUTXOIndex * Change Dialing to DEBUG * Change LogBlock location * Rename StopNotify to StopNotifying * Add sanity check * Add comment * Remove receiver from serialization functions Co-authored-by: Elichai Turkel <elichai.turkel@gmail.com>
32 lines
910 B
Go
32 lines
910 B
Go
package externalapi
|
|
|
|
// UTXOCollection represents a collection of UTXO entries, indexed by their outpoint
|
|
type UTXOCollection interface {
|
|
Iterator() ReadOnlyUTXOSetIterator
|
|
Get(outpoint *DomainOutpoint) (UTXOEntry, bool)
|
|
Contains(outpoint *DomainOutpoint) bool
|
|
Len() int
|
|
}
|
|
|
|
// UTXODiff represents the diff between two UTXO sets
|
|
type UTXODiff interface {
|
|
ToAdd() UTXOCollection
|
|
ToRemove() UTXOCollection
|
|
WithDiff(other UTXODiff) (UTXODiff, error)
|
|
DiffFrom(other UTXODiff) (UTXODiff, error)
|
|
CloneMutable() MutableUTXODiff
|
|
}
|
|
|
|
// MutableUTXODiff represents a UTXO-Diff that can be mutated
|
|
type MutableUTXODiff interface {
|
|
ToImmutable() UTXODiff
|
|
|
|
WithDiff(other UTXODiff) (UTXODiff, error)
|
|
DiffFrom(other UTXODiff) (UTXODiff, error)
|
|
ToAdd() UTXOCollection
|
|
ToRemove() UTXOCollection
|
|
|
|
WithDiffInPlace(other UTXODiff) error
|
|
AddTransaction(transaction *DomainTransaction, blockBlueScore uint64) error
|
|
}
|