Skip to content

Commit

Permalink
Merge remote-tracking branch 'github-pull/53/head'
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-jr committed Dec 16, 2024
2 parents 411265f + 467ba47 commit c4a7b3d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/datum_conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,12 @@ int datum_read_config(const char *conffile) {

if (roundDownToPowerOfTwo_64(datum_config.stratum_v1_vardiff_min) != datum_config.stratum_v1_vardiff_min) {
const int nv = roundDownToPowerOfTwo_64(datum_config.stratum_v1_vardiff_min);
DLOG_WARN("stratum.stratum_v1_vardiff_min MUST be a power of two. adjusting from %d to %d", datum_config.stratum_v1_vardiff_min, nv);
DLOG_WARN("stratum.vardiff_min MUST be a power of two. adjusting from %d to %d", datum_config.stratum_v1_vardiff_min, nv);
datum_config.stratum_v1_vardiff_min = nv;
}

if (datum_config.stratum_v1_vardiff_min < 1) {
DLOG_FATAL("Stratum server stratum.stratum_v1_vardiff_min must be at least 1 (suggest at least 1024, but more likely 32768)");
DLOG_FATAL("Stratum server stratum.vardiff_min must be at least 1 (suggest at least 1024, but more likely 32768)");
return 0;
}

Expand All @@ -362,6 +362,16 @@ int datum_read_config(const char *conffile) {
return 0;
}

if (datum_config.stratum_v1_share_stale_seconds < 60) {
DLOG_FATAL("Stratum server stratum.share_stale_seconds must be at least 60 (suggest 120)");
return 0;
}

if (datum_config.stratum_v1_share_stale_seconds > 150) {
DLOG_FATAL("Stratum server stratum.share_stale_seconds must not exceed 150 (suggest 120)");
return 0;
}

if (datum_config.datum_protocol_global_timeout < (datum_config.bitcoind_work_update_seconds+5)) {
DLOG_FATAL("DATUM protocol global timeout must be at least the work update interval plus 5 seconds.");
return 0;
Expand Down

0 comments on commit c4a7b3d

Please sign in to comment.