Browse Source

Bugfix: add_pool: If no current pool set, initialise it (otherwise pool testing may start a longpoll thread which tries to access currentpool uninitialised)

Luke Dashjr 11 years ago
parent
commit
222515952d
1 changed files with 3 additions and 0 deletions
  1. 3 0
      miner.c

+ 3 - 0
miner.c

@@ -774,6 +774,9 @@ struct pool *add_pool(void)
 
 	pools = realloc(pools, sizeof(struct pool *) * (total_pools + 2));
 	pools[total_pools++] = pool;
+	
+	if (!currentpool)
+		currentpool = pool;
 
 	return pool;
 }