mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-05 13:46:42 +00:00
16 lines
467 B
Go
16 lines
467 B
Go
package utxoserialization
|
|
|
|
import (
|
|
"github.com/kaspanet/kaspad/domain/consensus/model"
|
|
"github.com/kaspanet/kaspad/domain/consensus/utils/multiset"
|
|
)
|
|
|
|
// CalculateMultisetFromProtoUTXOSet calculates the Multiset corresponding to the given ProtuUTXOSet
|
|
func CalculateMultisetFromProtoUTXOSet(protoUTXOSet *ProtoUTXOSet) (model.Multiset, error) {
|
|
ms := multiset.New()
|
|
for _, utxo := range protoUTXOSet.Utxos {
|
|
ms.Add(utxo.EntryOutpointPair)
|
|
}
|
|
return ms, nil
|
|
}
|