mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-02 12:16:43 +00:00

* [NOD-1567] Add clone methods to data stores types * [NOD-1567] Fix comments * [NOD-1567] Fix test
22 lines
510 B
Go
22 lines
510 B
Go
package model
|
|
|
|
import "github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
|
|
|
// BlockRelations represents a block's parent/child relations
|
|
type BlockRelations struct {
|
|
Parents []*externalapi.DomainHash
|
|
Children []*externalapi.DomainHash
|
|
}
|
|
|
|
// Clone returns a clone of BlockRelations
|
|
func (br *BlockRelations) Clone() *BlockRelations {
|
|
if br == nil {
|
|
return nil
|
|
}
|
|
|
|
return &BlockRelations{
|
|
Parents: externalapi.CloneHashes(br.Parents),
|
|
Children: externalapi.CloneHashes(br.Children),
|
|
}
|
|
}
|