func (c *Chain) GetBlockByHeight(height int) *BlockNode {
	c.lock.Lock()
	defer c.lock.Unlock()

	if height < len(c.chain) && height >= 0 {
		return c.chain[height]
	}
	return nil
}
// GetBlockByHeight gets a block at a certain height or
// if it doesn't exist, returns nil.
GetBlockByHeight gets a block at a certain height or
if it doesn't exist, returns nil.
// GetBlockByHeight gets a block at a certain height or // if it doesn ' t exist returns nil .
func (c *Chain) GetBlockByHeight(height int) *BlockNode {
	c.lock.Lock()
	defer c.lock.Unlock()
	if height < len(c.chain) && height >= 0 {
		return c.chain[height]
	}
	return nil
}
func ( c * Chain ) GetBlockByHeight ( height int ) * BlockNode { c . lock . Lock ( ) defer c . lock . Unlock ( ) if height < len ( c . chain ) && height >= 0 { return c . chain [ height ] } return nil }
GetBlockByHeight gets a block at a certain height or
if it doesn't exist, returns nil.
GetBlockByHeight gets a block at a certain height or if it doesn ' t exist returns nil .