func (c *ShardChain) GetNodeBySlot(slot uint64) (*index.ShardBlockNode, error) {
	c.lock.Lock()
	defer c.lock.Unlock()

	if slot < c.RootSlot {
		return nil, fmt.Errorf("do not have slot %d, earliest slot is: %d", slot, c.RootSlot)
	}

	tip, err := c.tip()
	if err != nil {
		return nil, err
	}

	if slot > tip.Slot {
		return nil, fmt.Errorf("do not have slot %d, tip slot is: %d", slot, tip.Slot)
	}

	return tip.GetAncestorAtSlot(slot), nil
}
// GetNodeBySlot gets the block node at a certain slot.
GetNodeBySlot gets the block node at a certain slot.
// GetNodeBySlot gets the block node at a certain slot .
func (c *ShardChain) GetNodeBySlot(slot uint64) (*index.ShardBlockNode, error) {
	c.lock.Lock()
	defer c.lock.Unlock()
	if slot < c.RootSlot {
		return nil, fmt.Errorf("do not have slot %d, earliest slot is: %d", slot, c.RootSlot)
	}
	tip, err := c.tip()
	if err != nil {
		return nil, err
	}
	if slot > tip.Slot {
		return nil, fmt.Errorf("do not have slot %d, tip slot is: %d", slot, tip.Slot)
	}
	return tip.GetAncestorAtSlot(slot), nil
}
func ( c * ShardChain ) GetNodeBySlot ( slot uint64 ) ( * index . ShardBlockNode , error ) { c . lock . Lock ( ) defer c . lock . Unlock ( ) if slot < c . RootSlot { return nil , fmt . Errorf ( " " , slot , c . RootSlot ) } tip , err := c . tip ( ) if err != nil { return nil , err } if slot > tip . Slot { return nil , fmt . Errorf ( " " , slot , tip . Slot ) } return tip . GetAncestorAtSlot ( slot ) , nil }
GetNodeBySlot gets the block node at a certain slot.
GetNodeBySlot gets the block node at a certain slot .