Skip to content

Commit

Permalink
Merge pull request #1 from Gustav-Simonsson/add_panic_on_ethash_full_…
Browse files Browse the repository at this point in the history
…null

Add panic if ethash_full_new returns NULL
  • Loading branch information
LefterisJP committed Apr 27, 2015
2 parents f8c34c9 + c079040 commit 9f463d4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ethash.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ func MakeDAG(blockNum uint64, test bool, dir string) *dag {
C.ethash_light_get_cache(cache.light),
nil,
)
if full == nil {
panic("ethash_full_new IO or memory error")
}
dag := &dag{full: full}
runtime.SetFinalizer(dag, freeDAG)
return dag
Expand Down

0 comments on commit 9f463d4

Please sign in to comment.