func NewShardBlockIndex(genesisBlock primitives.ShardBlock) *ShardBlockIndex {
	index := &ShardBlockIndex{
		Index: make(map[chainhash.Hash]*ShardBlockNode),
		Lock:  new(sync.RWMutex),
	}

	genesisHash, err := ssz.HashTreeRoot(genesisBlock)
	if err != nil {
		panic(err)
	}

	index.Index[genesisHash] = &ShardBlockNode{
		Parent:    nil,
		BlockHash: genesisHash,
		StateRoot: genesisBlock.Header.StateRoot,
		Slot:      0,
		Height:    0,
	}

	return index
}
// NewShardBlockIndex creates a new block index.
NewShardBlockIndex creates a new block index.
// NewShardBlockIndex creates a new block index .
func NewShardBlockIndex(genesisBlock primitives.ShardBlock) *ShardBlockIndex {
	index := &ShardBlockIndex{
		Index: make(map[chainhash.Hash]*ShardBlockNode),
		Lock:  new(sync.RWMutex),
	}
	genesisHash, err := ssz.HashTreeRoot(genesisBlock)
	if err != nil {
		panic(err)
	}
	index.Index[genesisHash] = &ShardBlockNode{
		Parent:    nil,
		BlockHash: genesisHash,
		StateRoot: genesisBlock.Header.StateRoot,
		Slot:      0,
		Height:    0,
	}
	return index
}
func NewShardBlockIndex ( genesisBlock primitives . ShardBlock ) * ShardBlockIndex { index := & ShardBlockIndex { Index : make ( map [ chainhash . Hash ] * ShardBlockNode ) , Lock : new ( sync . RWMutex ) , } genesisHash , err := ssz . HashTreeRoot ( genesisBlock ) if err != nil { panic ( err ) } index . Index [ genesisHash ] = & ShardBlockNode { Parent : nil , BlockHash : genesisHash , StateRoot : genesisBlock . Header . StateRoot , Slot : 0 , Height : 0 , } return index }
NewShardBlockIndex creates a new block index.
NewShardBlockIndex creates a new block index .