From 21d928b543c08f6df5a174c773de7c1d9ca0c889 Mon Sep 17 00:00:00 2001 From: phm Date: Sat, 22 Mar 2014 14:16:49 +0100 Subject: [PATCH] Fixed problem with invalid stratum difficulty for Quark, AnimeCoin and QubitCoin. --- util.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util.c b/util.c index a271f77f..2e105d2a 100644 --- a/util.c +++ b/util.c @@ -45,6 +45,8 @@ #include "util.h" #define DEFAULT_SOCKWAIT 60 +#define DM_SELECT(x, y, z) (dm_mode == DM_BITCOIN ? x : (dm_mode == DM_QUARKCOIN ? y : z)) +extern enum diff_calc_mode dm_mode; bool successful_connect = false; static void keep_sockalive(SOCKETTYPE fd) @@ -1642,7 +1644,7 @@ static bool parse_diff(struct pool *pool, json_t *val) { double old_diff, diff; - diff = json_number_value(json_array_get(val, 0)); + diff = json_number_value(json_array_get(val, 0)) * DM_SELECT(1, 256, 1); if (diff == 0) return false;