From c7d8b774db263a767a4899566217ddacbdc64541 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Tue, 13 Dec 2016 12:07:43 +1100 Subject: [PATCH] Avoid dereference crash on startup with instantly connecting miners. --- src/stratifier.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/stratifier.c b/src/stratifier.c index 3ae9efb5..d846ede0 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -4341,6 +4341,10 @@ static bool new_enonce1(ckpool_t *ckp, sdata_t *ckp_sdata, sdata_t *sdata, strat } } + /* Still initialising */ + if (unlikely(!sdata->current_workbase)) + return false; + /* instance_lock protects enonce1_64. Incrementing a little endian 64bit * number ensures that no matter how many of the bits we take from the * left depending on nonce2 length, we'll always get a changing value