func (node *BlockNode) GetAncestorAtSlot(slot uint64) *BlockNode {
	if node.Slot < slot {
		return nil
	}

	current := node

	// go up to the slot after the slot we're searching for
	for slot < current.Slot {
		current = current.Parent
	}
	return current
}
// GetAncestorAtSlot gets the ancestor of a block at a certain slot.
// Defined if node.Slot >= slot.
GetAncestorAtSlot gets the ancestor of a block at a certain slot.
Defined if node.Slot >= slot.
// GetAncestorAtSlot gets the ancestor of a block at a certain slot . // Defined if node . Slot > = slot .
func (node *BlockNode) GetAncestorAtSlot(slot uint64) *BlockNode {
	if node.Slot < slot {
		return nil
	}
	current := node
	for slot < current.Slot {
		current = current.Parent
	}
	return current
}
func ( node * BlockNode ) GetAncestorAtSlot ( slot uint64 ) * BlockNode { if node . Slot < slot { return nil } current := node for slot < current . Slot { current = current . Parent } return current }
GetAncestorAtSlot gets the ancestor of a block at a certain slot.
GetAncestorAtSlot gets the ancestor of a block at a certain slot .
// go up to the slot after the slot we're searching for