mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-09-16 23:49:44 +00:00
stratum: prevent some negative values
This commit is contained in:
parent
778f9aeb85
commit
e67634d82a
1 changed files with 3 additions and 1 deletions
|
@ -530,8 +530,10 @@ void db_store_stats(YAAMP_DB *db, YAAMP_CLIENT *client, json_value *stats)
|
||||||
realmemf = json_int_safe(stats, "curr_memf");
|
realmemf = json_int_safe(stats, "curr_memf");
|
||||||
plimit = json_int_safe(stats, "plimit");
|
plimit = json_int_safe(stats, "plimit");
|
||||||
intensity = json_double_safe(stats, "intensity");
|
intensity = json_double_safe(stats, "intensity");
|
||||||
throughput = json_double_safe(stats, "throughput");
|
|
||||||
khashes = json_double_safe(stats, "khashes");
|
khashes = json_double_safe(stats, "khashes");
|
||||||
|
throughput = json_double_safe(stats, "throughput");
|
||||||
|
if (throughput < 0.) throughput = 0.;
|
||||||
|
if (khashes < 0. || intensity < 0.) return;
|
||||||
|
|
||||||
db_query(db, "INSERT INTO benchmarks("
|
db_query(db, "INSERT INTO benchmarks("
|
||||||
"time, algo, type, device, arch, vendorid, os, driver,"
|
"time, algo, type, device, arch, vendorid, os, driver,"
|
||||||
|
|
Loading…
Add table
Reference in a new issue