@@ -251,7 +251,7 @@ void datum_config_set_default(const T_DATUM_CONFIG_ITEM *c) {
251251 }
252252}
253253
254- int datum_config_parse_username_mods (struct datum_username_mod * * const umods_p , json_t * const item ) {
254+ int datum_config_parse_username_mods (struct datum_username_mod * * const umods_p , json_t * const item , const bool log_errors ) {
255255 if (!json_object_size (item )) {
256256 if (json_is_null (item ) || json_is_object (item )) {
257257 free (* umods_p );
@@ -316,6 +316,11 @@ int datum_config_parse_username_mods(struct datum_username_mod ** const umods_p,
316316 ++ addr_range ;
317317 if (nonce_max == 0xffff ) break ;
318318 }
319+ if (log_errors && (addr_range == umod -> ranges || addr_range [-1 ].max != 0xffff )) {
320+ double missing_percent = 100 * (1 - sum );
321+ const unsigned int missing_percent_precision = datum_double_precision (& missing_percent );
322+ DLOG_ERROR ("Username modifier '%s' is configured to not distribute %.*f%% of shares!" , modname , missing_percent_precision , missing_percent );
323+ }
319324 addr_range [0 ].addr = NULL ;
320325 assert ((uint8_t * )addr_range <= & ((uint8_t * )umod )[umod -> sz ]); // otherwise we overwrote strings!
321326 assert (p <= & ((uint8_t * )* umods_p )[sz ]); // otherwise we overran the buffer!
@@ -398,7 +403,7 @@ int datum_config_parse_value(const T_DATUM_CONFIG_ITEM *c, json_t *item) {
398403 }
399404
400405 case DATUM_CONF_USERNAME_MODS : {
401- return datum_config_parse_username_mods (c -> ptr , item );
406+ return datum_config_parse_username_mods (c -> ptr , item , true );
402407 }
403408 }
404409
0 commit comments