(h uint32, b *types.BPBlock, p *blockNode)
| 35 | } |
| 36 | |
| 37 | func newBlockNode(h uint32, b *types.BPBlock, p *blockNode) (node *blockNode) { |
| 38 | node = &blockNode{ |
| 39 | parent: p, |
| 40 | |
| 41 | count: func() uint32 { |
| 42 | if p != nil { |
| 43 | return p.count + 1 |
| 44 | } |
| 45 | return 0 |
| 46 | }(), |
| 47 | height: h, |
| 48 | |
| 49 | hash: b.SignedHeader.DataHash, |
| 50 | txCount: len(b.Transactions), |
| 51 | } |
| 52 | node.block.Store(b) |
| 53 | return |
| 54 | } |
| 55 | |
| 56 | // newNonCacheBlockNode returns a block node without the *types.BPBlock cached. |
| 57 | func newNonCacheBlockNode(h uint32, b *types.BPBlock, p *blockNode) (node *blockNode) { |
no outgoing calls