From 8fd398bb42c0b6976c8d2c66687c54f8b4b29c3e Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 4 Oct 2017 14:38:10 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_nativeDEX.c | 4 +++- iguana/exchanges/LP_remember.c | 15 +++++++++------ iguana/exchanges/LP_transaction.c | 3 +++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index cddae12d2..0c43d6503 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -26,7 +26,9 @@ // bittrex balancing // withdraw // stats, fix pricearray -// so alice doesnt detect swap complete and electrum doesnt get .finished after swapstatus. ok, seems like an electrum tx construction/detection issue in the swapstatus path and some wonkiness with SWAP complete detection in general. I need to cleanup that logic a lot +// better error message in ordermatch +// verify portfolio +// alice doesnt detect swap complete and electrum doesnt get .finished after swapstatus. ok, seems like an electrum tx construction/detection issue in the swapstatus path and some wonkiness with SWAP complete detection in general. I need to cleanup that logic a lot // unduplicated bugs: // swap cancel should cleanly cancel diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 74f0f4f53..eefab2383 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -957,9 +957,12 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti Apaymentspent = txids[BASILISK_BOBSPEND]; else Apaymentspent = txids[BASILISK_ALICERECLAIM]; } - bits256_str(str,paymentspent), jaddbits256(item,"paymentspent",paymentspent); - bits256_str(str,Apaymentspent), jaddbits256(item,"Apaymentspent",Apaymentspent); - bits256_str(str,depositspent), jaddbits256(item,"depositspent",depositspent); + jaddbits256(item,"bobdeposit",txids[BASILISK_BOBDEPOSIT]); + jaddbits256(item,"alicepayment",txids[BASILISK_ALICEPAYMENT]); + jaddbits256(item,"bobpayment",txids[BASILISK_BOBPAYMENT]); + jaddbits256(item,"paymentspent",paymentspent); + jaddbits256(item,"Apaymentspent",Apaymentspent); + jaddbits256(item,"depositspent",depositspent); if ( origfinishedflag == 0 && finishedflag != 0 ) { //printf("SWAP %u-%u finished!\n",requestid,quoteid); @@ -1014,7 +1017,7 @@ char *basilisk_swaplist() } jaddstr(retjson,"result","success"); jadd(retjson,"swaps",array); - if ( cJSON_GetArraySize(array) > 0 ) + if ( 0 && cJSON_GetArraySize(array) > 0 ) { totalsobj = cJSON_CreateObject(); for (Btotal=i=0; i 0 ) jaddnum(retjson,"avesell",(double)-Btotal/Ktotal); } - array = cJSON_CreateArray(); - /*for (i=0; ilinfos)/sizeof(*myinfo->linfos); i++) + /*array = cJSON_CreateArray(); + for (i=0; ilinfos)/sizeof(*myinfo->linfos); i++) { if ( myinfo->linfos[i].base[0] != 0 && myinfo->linfos[i].rel[0] != 0 ) jaddi(array,linfo_json(&myinfo->linfos[i])); diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 1facc6725..2c8bcff35 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -49,7 +49,10 @@ bits256 LP_broadcast(char *txname,char *symbol,char *txbytes,bits256 expectedtxi { decode_hex(txid.bytes,32,retstr); if ( bits256_cmp(txid,expectedtxid) == 0 || (bits256_nonz(expectedtxid) == 0 && bits256_nonz(txid) != 0) ) + { sentflag = 1; + expectedtxid = txid; + } } else if ( (retjson= cJSON_Parse(retstr)) != 0 ) {