From e7f86ecb39da9e07e1570653e2d29958e272c8ca Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 24 Nov 2017 14:08:54 +0400 Subject: [PATCH] Test --- iguana/exchanges/LP_commands.c | 1 + iguana/exchanges/LP_stats.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 618aec6b0..978fb05b9 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -304,6 +304,7 @@ zeroconf_claim(address, expiration=0)\n\ struct LP_address *ap; char *coinaddr; if ( (ptr= LP_coinsearch("KMD")) != 0 && (coinaddr= jstr(argjson,"address")) != 0 ) { + LP_statslog_parse(); LP_zeroconf_deposits(ptr); if ( (ap= LP_addressfind(ptr,coinaddr)) != 0 ) { diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 9c3dd87cd..ffb8d0c8f 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -84,6 +84,7 @@ void LP_statslog_parseline(cJSON *lineobj) int32_t LP_statslog_parse() { static long lastpos; FILE *fp; char line[8192]; cJSON *lineobj; int32_t n = 0; + portable_mutex_lock(&LP_logmutex); if ( (fp= fopen(LP_STATSLOG_FNAME,"rb")) != 0 ) { if ( lastpos > 0 ) @@ -110,6 +111,7 @@ int32_t LP_statslog_parse() } fclose(fp); } + portable_mutex_unlock(&LP_logmutex); return(n); }