fetchNodeList returns the block node list within range [from, n.count] from node head n.
(from uint32)
| 70 | |
| 71 | // fetchNodeList returns the block node list within range [from, n.count] from node head n. |
| 72 | func (n *blockNode) fetchNodeList(from uint32) (bl []*blockNode) { |
| 73 | if n.count < from { |
| 74 | return |
| 75 | } |
| 76 | bl = make([]*blockNode, n.count-from+1) |
| 77 | var iter = n |
| 78 | for i := len(bl) - 1; i >= 0; i-- { |
| 79 | bl[i] = iter |
| 80 | iter = iter.parent |
| 81 | } |
| 82 | return |
| 83 | } |
| 84 | |
| 85 | func (n *blockNode) ancestor(h uint32) *blockNode { |
| 86 | if h > n.height { |
no outgoing calls