MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / ancestor

Method ancestor

blockproducer/blocknode.go:85–99  ·  view source on GitHub ↗
(h uint32)

Source from the content-addressed store, hash-verified

83}
84
85func (n *blockNode) ancestor(h uint32) *blockNode {
86 if h > n.height {
87 return nil
88 }
89
90 ancestor := n
91 for ancestor != nil && ancestor.height > h {
92 ancestor = ancestor.parent
93 }
94 if ancestor != nil && ancestor.height != h {
95 ancestor = nil
96 }
97
98 return ancestor
99}
100
101func (n *blockNode) ancestorByCount(c uint32) *blockNode {
102 if c > n.count {

Callers 3

TestBlockNodeFunction · 0.45
applyBlockMethod · 0.45
fetchBlockByHeightMethod · 0.45

Calls

no outgoing calls

Tested by 1

TestBlockNodeFunction · 0.36