|
|
@ -496,7 +496,7 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,cJSON *argjson,char *base,c |
|
|
|
bits256 zero; |
|
|
|
memset(zero.bytes,0,sizeof(zero)); |
|
|
|
LP_reserved_msg(1,base,rel,zero,jprint(retjson,0)); |
|
|
|
LP_reserved_msg(0,base,rel,zero,jprint(retjson,0)); |
|
|
|
//LP_reserved_msg(0,base,rel,zero,jprint(retjson,0));
|
|
|
|
free_json(retjson); |
|
|
|
retval = 0; |
|
|
|
} else printf("error launching swaploop\n"); |
|
|
@ -927,8 +927,8 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, |
|
|
|
range = (qprice - price); |
|
|
|
price += (r * range) / 100.; |
|
|
|
bestprice = LP_bob_competition(&counter,aliceid,price,0); |
|
|
|
printf(">>>>>>>>>>>>> price %.8f qprice %.8f r.%d range %.8f -> %.8f, bestprice %.8f counter.%d\n",ask,qprice,r,range,price,bestprice,counter); |
|
|
|
if ( counter > 3 || price > bestprice ) // skip if late or bad price
|
|
|
|
printf("%llu >>>>>>> price %.8f qprice %.8f r.%d range %.8f -> %.8f, bestprice %.8f counter.%d\n",(long long)aliceid,ask,qprice,r,range,price,bestprice,counter); |
|
|
|
if ( counter > 2 || price > bestprice*.99 ) // skip if late or bad price
|
|
|
|
return(retval); |
|
|
|
} else return(retval); |
|
|
|
//LP_RTmetrics_update(Q.srccoin,Q.destcoin);
|
|
|
|