mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-23 06:22:31 +00:00

* Replace blue score with DAA score in UTXO entries * Use DAA score for coinbase maturity * Use DAA score for sequence lock * Fix calcBlockSubsidy to use DAA score * Don't pay to blocks that are not included in the DAA added blocks, and bestow red blocks reward to the merging block * Fix TestGetPruningPointUTXOs * Fix TestTransactionAcceptance * Fix TestChainedTransactions * Fix TestVirtualDiff * Fix TestBlockWindow * Fix TestPruning * Use NewFromSlice instead of manually creating the hash set * Add assert * Add comment * Remove redundant call to UpdateDAADataAndReturnDifficultyBits * Add RequiredDifficulty, rename UpdateDAADataAndReturnDifficultyBits to StageDAADataAndReturnRequiredDifficulty and add comments * Make buildUTXOInvalidHeader get bits as an argument * Fix comments
32 lines
909 B
Go
32 lines
909 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, blockDAAScore uint64) error
|
|
}
|