MCPcopy Create free account
hub / github.com/SmartPool/smartpool-client / buildDagTree

Method buildDagTree

ethereum/share.go:129–143  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

127}
128
129func (s *Share) buildDagTree() {
130 indices := ethash.Instance.GetVerificationIndices(s)
131 s.dt = mtree.NewDagTree()
132 s.dt.RegisterIndex(indices...)
133 seedHash, err := ethash.GetSeedHash(s.NumberU64())
134 if err != nil {
135 panic(err)
136 }
137 path := filepath.Join(
138 ethash.DefaultDir,
139 fmt.Sprintf("full-R%s-%s", "23", hex.EncodeToString(seedHash[:8])),
140 )
141 processDuringRead(path, s.dt)
142 s.dt.Finalize()
143}
144
145func (s *Share) DAGElementArray() []*big.Int {
146 if s.dt == nil {

Callers 2

DAGElementArrayMethod · 0.95
DAGProofArrayMethod · 0.95

Implementers 2

testShareprotocol/test_share.go
Shareethereum/share.go

Calls 5

NumberU64Method · 0.95
processDuringReadFunction · 0.85
RegisterIndexMethod · 0.80
FinalizeMethod · 0.80

Tested by

no test coverage detected