From 9c9f2766b90e2bfb8dfebbbfd669e490a62fd13d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 3 Feb 2018 20:26:47 +0200 Subject: [PATCH] Test --- iguana/exchanges/LP_commands.c | 5 ++++- iguana/exchanges/LP_nativeDEX.c | 33 ++++++++++++++++++--------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 94186c659..290844812 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -643,7 +643,10 @@ jpg(srcfile, destfile, power2=7, password, data="", required, ind=0)\n\ if ( strcmp(method,"swapstatus") == 0 ) return(LP_swapstatus_recv(argjson)); else if ( strcmp(method,"gettradestatus") == 0 ) - return(LP_gettradestatus(j64bits(argjson,"aliceid"),juint(argjson,"requestid"),juint(argjson,"quoteid"))); + { + retstr = clonestr("{\"error\":\"deprecated\"}"); + //return(LP_gettradestatus(j64bits(argjson,"aliceid"),juint(argjson,"requestid"),juint(argjson,"quoteid"))); + } else if ( strcmp(method,"postprice") == 0 ) return(LP_postprice_recv(argjson)); else if ( strcmp(method,"uitem") == 0 ) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index e5a9c3fe7..840be075e 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -1094,7 +1094,20 @@ void LP_reserved_msgs(void *ignore) { nonz = 0; LP_millistats_update(&LP_reserved_msgs_stats); - if ( num_Reserved_msgs[0] > 0 || num_Reserved_msgs[1] > 0 ) + if ( num_Reserved_msgs[1] > 0 ) + { + nonz++; + portable_mutex_lock(&LP_reservedmutex); + if ( num_Reserved_msgs[1] > 0 ) + { + num_Reserved_msgs[1]--; + //printf("PRIORITY BROADCAST.(%s)\n",Reserved_msgs[1][num_Reserved_msgs[1]]); + LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[1][num_Reserved_msgs[1]]); + Reserved_msgs[1][num_Reserved_msgs[1]] = 0; + } + portable_mutex_unlock(&LP_reservedmutex); + } + else if ( num_Reserved_msgs[0] > 0 ) { nonz++; flag = 0; @@ -1109,20 +1122,10 @@ void LP_reserved_msgs(void *ignore) if ( flag == 1 ) { portable_mutex_lock(&LP_reservedmutex); - if ( num_Reserved_msgs[1] > 0 ) - { - num_Reserved_msgs[1]--; -//printf("PRIORITY BROADCAST.(%s)\n",Reserved_msgs[1][num_Reserved_msgs[1]]); - LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[1][num_Reserved_msgs[1]]); - Reserved_msgs[1][num_Reserved_msgs[1]] = 0; - } - else if ( num_Reserved_msgs[0] > 0 ) - { - num_Reserved_msgs[0]--; -//printf("BROADCAST.(%s)\n",Reserved_msgs[0][num_Reserved_msgs[0]]); - LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[0][num_Reserved_msgs[0]]); - Reserved_msgs[0][num_Reserved_msgs[0]] = 0; - } + num_Reserved_msgs[0]--; + //printf("BROADCAST.(%s)\n",Reserved_msgs[0][num_Reserved_msgs[0]]); + LP_broadcast_message(LP_mypubsock,"","",zero,Reserved_msgs[0][num_Reserved_msgs[0]]); + Reserved_msgs[0][num_Reserved_msgs[0]] = 0; portable_mutex_unlock(&LP_reservedmutex); } }