From c0790402f01d61380fb39412e68921ae6356de57 Mon Sep 17 00:00:00 2001 From: Gustav Simonsson Date: Mon, 27 Apr 2015 12:01:34 +0200 Subject: [PATCH] Add panic if ethash_full_new returns NULL --- ethash.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ethash.go b/ethash.go index 5759ef9e..34ec753c 100644 --- a/ethash.go +++ b/ethash.go @@ -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