From c6a48858249122602e7701cc966bcc7cb22b6ab9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 15 Jun 2017 20:45:07 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_quotes.c | 2 +- iguana/exchanges/LP_utxos.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/exchanges/LP_quotes.c b/iguana/exchanges/LP_quotes.c index c4c3826ff..502e0cd8f 100644 --- a/iguana/exchanges/LP_quotes.c +++ b/iguana/exchanges/LP_quotes.c @@ -319,7 +319,7 @@ int32_t LP_connectstartbob(int32_t pubsock,struct LP_utxoinfo *utxo,cJSON *argjs jaddnum(retjson,"requestid",Q.R.requestid); jaddnum(retjson,"quoteid",Q.R.quoteid); retstr = jprint(retjson,1); - printf("BOB sends back.(%s)\n",retstr); + char str[65]; printf("BOB pubsock.%d sends back.(%s) to (%s)\n",pubsock,retstr,bits256_str(str,utxo->S.otherpubkey)); if ( pubsock >= 0 ) LP_send(pubsock,retstr,0); LP_forward(myipaddr,pubsock,profitmargin,utxo->S.otherpubkey,retstr,1); diff --git a/iguana/exchanges/LP_utxos.c b/iguana/exchanges/LP_utxos.c index 9e5be5bc5..1febfa78b 100644 --- a/iguana/exchanges/LP_utxos.c +++ b/iguana/exchanges/LP_utxos.c @@ -140,27 +140,28 @@ void _LP_unavailableset(struct LP_utxoinfo *utxo,bits256 otherpubkey) void LP_unavailableset(struct LP_utxoinfo *utxo,bits256 otherpubkey) { - struct LP_utxoinfo *ptrs[8]; int32_t i,n; + struct LP_utxoinfo *ptrs[8]; int32_t i,n; struct _LP_utxoinfo u; memset(ptrs,0,sizeof(ptrs)); if ( (n= LP_utxocollisions(ptrs,utxo)) > 0 ) { for (i=0; ipayment.txid),utxo->payment.vout,n); + char str[65],str2[65]; printf("UTXO.[%d] RESERVED %s/v%d %s/v%d collisions.%d\n",utxo->iambob,bits256_str(str,utxo->payment.txid),utxo->payment.vout,bits256_str(str2,u.txid),u.vout,n); _LP_unavailableset(utxo,otherpubkey); } void LP_availableset(struct LP_utxoinfo *utxo) { - struct LP_utxoinfo *ptrs[8]; int32_t i,n; + struct LP_utxoinfo *ptrs[8]; int32_t i,n; struct _LP_utxoinfo u; memset(ptrs,0,sizeof(ptrs)); if ( (n= LP_utxocollisions(ptrs,utxo)) > 0 ) { for (i=0; ipayment.txid),utxo->payment.vout,n); + u = (utxo->iambob != 0) ? utxo->deposit : utxo->fee; + char str[65],str2[65]; printf("UTXO.[%d] AVAIL %s/v%d %s/v%d collisions.%d\n",utxo->iambob,bits256_str(str,utxo->payment.txid),utxo->payment.vout,bits256_str(str2,u.txid),u.vout,n); _LP_availableset(utxo); }