|  |  | @ -125,6 +125,7 @@ static char *status_chars = "|/-\\"; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | static char *restorefrom; |  |  |  | static char *restorefrom; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | bool genpayout_auto; | 
			
		
	
		
		
			
				
					
					|  |  |  | bool markersummary_auto; |  |  |  | bool markersummary_auto; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | int switch_state = SWITCH_STATE_ALL; |  |  |  | int switch_state = SWITCH_STATE_ALL; | 
			
		
	
	
		
		
			
				
					|  |  | @ -1432,6 +1433,13 @@ static bool setup_data() | 
			
		
	
		
		
			
				
					
					|  |  |  | 	mutex_init(&wq_waitlock); |  |  |  | 	mutex_init(&wq_waitlock); | 
			
		
	
		
		
			
				
					
					|  |  |  | 	cond_init(&wq_waitcond); |  |  |  | 	cond_init(&wq_waitcond); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	LOGWARNING("%sStartup payout generation state is %s", | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		   genpayout_auto ? "" : "WARNING: ", | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		   genpayout_auto ? "On" : "Off"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	LOGWARNING("%sStartup mark generation state is %s", | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		   markersummary_auto ? "" : "WARNING: ", | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		   markersummary_auto ? "On" : "Off"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	alloc_storage(); |  |  |  | 	alloc_storage(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	setnow(&db_stt); |  |  |  | 	setnow(&db_stt); | 
			
		
	
	
		
		
			
				
					|  |  | @ -3054,7 +3062,12 @@ static void summarise_blocks() | 
			
		
	
		
		
			
				
					
					|  |  |  | 			   diffacc, diffinv, shareacc, shareinv, elapsed); |  |  |  | 			   diffacc, diffinv, shareacc, shareinv, elapsed); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 		// Now the summarisation is confirmed, generate the payout data
 |  |  |  | 		// Now the summarisation is confirmed, generate the payout data
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 		pplns_block(blocks); |  |  |  | 		if (genpayout_auto) | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			pplns_block(blocks); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			LOGWARNING("%s() Auto payout generation disabled", | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				   __func__); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  |  | 	} else { |  |  |  | 	} else { | 
			
		
	
		
		
			
				
					
					|  |  |  | 		LOGERR("%s() block %d, failed to confirm stats", |  |  |  | 		LOGERR("%s() block %d, failed to confirm stats", | 
			
		
	
		
		
			
				
					
					|  |  |  | 			__func__, blocks->height); |  |  |  | 			__func__, blocks->height); | 
			
		
	
	
		
		
			
				
					|  |  | @ -5402,11 +5415,13 @@ static void check_restore_dir(char *name) | 
			
		
	
		
		
			
				
					
					|  |  |  | static struct option long_options[] = { |  |  |  | static struct option long_options[] = { | 
			
		
	
		
		
			
				
					
					|  |  |  | 	{ "config",		required_argument,	0,	'c' }, |  |  |  | 	{ "config",		required_argument,	0,	'c' }, | 
			
		
	
		
		
			
				
					
					|  |  |  | 	{ "dbname",		required_argument,	0,	'd' }, |  |  |  | 	{ "dbname",		required_argument,	0,	'd' }, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	// generate = enable payout pplns auto generation
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	{ "generate",		no_argument,		0,	'g' }, | 
			
		
	
		
		
			
				
					
					|  |  |  | 	{ "help",		no_argument,		0,	'h' }, |  |  |  | 	{ "help",		no_argument,		0,	'h' }, | 
			
		
	
		
		
			
				
					
					|  |  |  | 	{ "killold",		no_argument,		0,	'k' }, |  |  |  | 	{ "killold",		no_argument,		0,	'k' }, | 
			
		
	
		
		
			
				
					
					|  |  |  | 	{ "loglevel",		required_argument,	0,	'l' }, |  |  |  | 	{ "loglevel",		required_argument,	0,	'l' }, | 
			
		
	
		
		
			
				
					
					|  |  |  | 	// markersummary = enable markersummary auto generation
 |  |  |  | 	// marker = enable mark/workmarker/markersummary auto generation
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 	{ "markersummary",	no_argument,		0,	'm' }, |  |  |  | 	{ "marker",		no_argument,		0,	'm' }, | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 	{ "name",		required_argument,	0,	'n' }, |  |  |  | 	{ "name",		required_argument,	0,	'n' }, | 
			
		
	
		
		
			
				
					
					|  |  |  | 	{ "dbpass",		required_argument,	0,	'p' }, |  |  |  | 	{ "dbpass",		required_argument,	0,	'p' }, | 
			
		
	
		
		
			
				
					
					|  |  |  | 	{ "btc-pass",		required_argument,	0,	'P' }, |  |  |  | 	{ "btc-pass",		required_argument,	0,	'P' }, | 
			
		
	
	
		
		
			
				
					|  |  | @ -5462,6 +5477,9 @@ int main(int argc, char **argv) | 
			
		
	
		
		
			
				
					
					|  |  |  | 				while (*kill) |  |  |  | 				while (*kill) | 
			
		
	
		
		
			
				
					
					|  |  |  | 					*(kill++) = ' '; |  |  |  | 					*(kill++) = ' '; | 
			
		
	
		
		
			
				
					
					|  |  |  | 				break; |  |  |  | 				break; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			case 'g': | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				genpayout_auto = true; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 				break; | 
			
		
	
		
		
			
				
					
					|  |  |  | 			case 'h': |  |  |  | 			case 'h': | 
			
		
	
		
		
			
				
					
					|  |  |  | 				for (j = 0; long_options[j].val; j++) { |  |  |  | 				for (j = 0; long_options[j].val; j++) { | 
			
		
	
		
		
			
				
					
					|  |  |  | 					struct option *jopt = &long_options[j]; |  |  |  | 					struct option *jopt = &long_options[j]; | 
			
		
	
	
		
		
			
				
					|  |  | 
 |