Skip to content

Commit

Permalink
Check share_stale_seconds is within range 60-150
Browse files Browse the repository at this point in the history
  • Loading branch information
BitcoinMechanic committed Dec 14, 2024
1 parent dafdaa0 commit 66e9af2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/datum_conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.stratum_v1_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.stratum_v1_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 66e9af2

Please sign in to comment.