| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -1434,6 +1434,11 @@ out: | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return ret; | 
					 | 
					 | 
					 | 
						return ret; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					static inline bool client_active(stratum_instance_t *client) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					{ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
						return (client->authorised && !client->dropped); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					/* For creating a list of sends without locking that can then be concatenated
 | 
					 | 
					 | 
					 | 
					/* For creating a list of sends without locking that can then be concatenated
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 * to the stratum_sends list. Minimises locking and avoids taking recursive | 
					 | 
					 | 
					 | 
					 * to the stratum_sends list. Minimises locking and avoids taking recursive | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 * locks. */ | 
					 | 
					 | 
					 | 
					 * locks. */ | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -1453,7 +1458,7 @@ static void stratum_broadcast(sdata_t *sdata, json_t *val) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							ckmsg_t *client_msg; | 
					 | 
					 | 
					 | 
							ckmsg_t *client_msg; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							smsg_t *msg; | 
					 | 
					 | 
					 | 
							smsg_t *msg; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (!client->authorised) | 
					 | 
					 | 
					 | 
							if (!client_active(client)) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								continue; | 
					 | 
					 | 
					 | 
								continue; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							client_msg = ckalloc(sizeof(ckmsg_t)); | 
					 | 
					 | 
					 | 
							client_msg = ckalloc(sizeof(ckmsg_t)); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							msg = ckzalloc(sizeof(smsg_t)); | 
					 | 
					 | 
					 | 
							msg = ckzalloc(sizeof(smsg_t)); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -3358,7 +3363,7 @@ static void suggest_diff(stratum_instance_t *client, const char *method, const j | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						sdata_t *sdata = client->ckp->data; | 
					 | 
					 | 
					 | 
						sdata_t *sdata = client->ckp->data; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						int64_t sdiff; | 
					 | 
					 | 
					 | 
						int64_t sdiff; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						if (unlikely(!client->authorised)) { | 
					 | 
					 | 
					 | 
						if (unlikely(!client_active(client))) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							LOGWARNING("Attempted to suggest diff on unauthorised client %"PRId64, client->id); | 
					 | 
					 | 
					 | 
							LOGWARNING("Attempted to suggest diff on unauthorised client %"PRId64, client->id); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							return; | 
					 | 
					 | 
					 | 
							return; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						} | 
					 | 
					 | 
					 | 
						} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -4057,7 +4062,7 @@ static void *statsupdate(void *arg) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							ck_rlock(&sdata->instance_lock); | 
					 | 
					 | 
					 | 
							ck_rlock(&sdata->instance_lock); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							HASH_ITER(hh, sdata->stratum_instances, client, tmp) { | 
					 | 
					 | 
					 | 
							HASH_ITER(hh, sdata->stratum_instances, client, tmp) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								if (!client->authorised) | 
					 | 
					 | 
					 | 
								if (!client_active(client)) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									continue; | 
					 | 
					 | 
					 | 
									continue; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								per_tdiff = tvdiff(&now, &client->last_share); | 
					 | 
					 | 
					 | 
								per_tdiff = tvdiff(&now, &client->last_share); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |