From 66e9af286231f48f19d834635a000366a208f59a Mon Sep 17 00:00:00 2001 From: BitcoinMechanic Date: Sat, 14 Dec 2024 12:19:02 -0800 Subject: [PATCH] Check share_stale_seconds is within range 60-150 --- src/datum_conf.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/datum_conf.c b/src/datum_conf.c index 103e5d7..8f71a1f 100644 --- a/src/datum_conf.c +++ b/src/datum_conf.c @@ -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;