From 0287896b0afe22a479d56a29fc16ba2fc590b748 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Wed, 28 Feb 2018 11:08:23 +0100 Subject: [PATCH] stratum: add missing keccakc variant --- stratum/config.sample/keccakc.conf | 16 ++++++++++++++++ stratum/stratum.cpp | 7 ++++--- web/yaamp/core/functions/yaamp.php | 3 +++ 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 stratum/config.sample/keccakc.conf diff --git a/stratum/config.sample/keccakc.conf b/stratum/config.sample/keccakc.conf new file mode 100644 index 0000000..0be446a --- /dev/null +++ b/stratum/config.sample/keccakc.conf @@ -0,0 +1,16 @@ +[TCP] +server = yaamp.com +port = 5134 +password = tu8tu5 + +[SQL] +host = yaampdb +database = yaamp +username = root +password = patofpaq + +[STRATUM] +algo = keccakc +difficulty = 2 +max_ttf = 4000000 + diff --git a/stratum/stratum.cpp b/stratum/stratum.cpp index b120021..37f9bb4 100644 --- a/stratum/stratum.cpp +++ b/stratum/stratum.cpp @@ -142,8 +142,8 @@ YAAMP_ALGO g_algos[] = {"myr-gr", groestlmyriad_hash, 1, 0, 0}, /* groestl + sha 64 */ {"skein", skein_hash, 1, 0, 0}, {"tribus", tribus_hash, 1, 0, 0}, - {"a5a", a5a_hash, 0x10000, 0, 0}, {"keccak", keccak256_hash, 0x80, 0, sha256_hash_hex }, + {"keccakc", keccak256_hash, 0x100, 0, 0}, {"phi", phi_hash, 1, 0, 0}, {"polytimos", polytimos_hash, 1, 0, 0}, {"skunk", skunk_hash, 1, 0, 0}, @@ -157,6 +157,7 @@ YAAMP_ALGO g_algos[] = {"yescryptR16", yescryptR16_hash, 0x10000, 0, 0 }, {"zr5", zr5_hash, 1, 0, 0}, + {"a5a", a5a_hash, 0x10000, 0, 0}, {"hive", hive_hash, 0x10000, 0, 0}, {"m7m", m7m_hash, 0x10000, 0, 0}, {"veltor", veltor_hash, 1, 0, 0}, @@ -410,8 +411,8 @@ void *stratum_thread(void *p) stratumlog("%s socket accept() error %d\n", g_stratum_algo, error); failcount++; usleep(50000); - if (error == 24 && failcount > 16) { - g_exiting = true; + if (error == 24 && failcount > 5) { + g_exiting = true; // happen when max open files is reached (see ulimit) stratumlogdate("%s too much socket failure, exiting...\n", g_stratum_algo); exit(error); } diff --git a/web/yaamp/core/functions/yaamp.php b/web/yaamp/core/functions/yaamp.php index 0e8b90a..98e63cd 100755 --- a/web/yaamp/core/functions/yaamp.php +++ b/web/yaamp/core/functions/yaamp.php @@ -18,6 +18,7 @@ function yaamp_get_algos() 'deep', 'hmq1725', 'keccak', + 'keccakc', 'jha', 'hsr', 'lbry', @@ -151,6 +152,7 @@ function getAlgoColors($algo) 'hmq1725' => '#ffa0a0', 'hsr' => '#aa70ff', 'keccak' => '#c0f0c0', + 'keccakc' => '#c0f0c0', 'lbry' => '#b0d0e0', 'luffa' => '#a0c0c0', 'm7m' => '#d0a0a0', @@ -223,6 +225,7 @@ function getAlgoPort($algo) 'skein' => 4933, 'sib' => 5033, 'keccak' => 5133, + 'keccakc' => 5134, 'skein2' => 5233, //'groestl' => 5333, 'dmd-gr' => 5333,