From 85ee2a87719b799d71d740f00173067c590040e3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 28 Sep 2017 22:21:44 +0300 Subject: [PATCH] Test --- iguana/exchanges/LP_ordermatch.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 9a536a236..95a3d616f 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -683,16 +683,17 @@ char *LP_connectedalice(cJSON *argjson) // alice autxo = &A; butxo = &B; LP_abutxo_set(autxo,butxo,&Q); - if ( (autxo= LP_utxopairfind(0,Q.txid,Q.vout,Q.txid2,Q.vout2)) == 0 ) - { - printf("cant find autxo in quote\n"); - return(clonestr("{\"error\":\"quote autxo find error\"}")); - } - if ( autxo->S.swap != 0 ) + if ( (autxo= LP_utxopairfind(0,Q.txid,Q.vout,Q.txid2,Q.vout2)) != 0 && autxo->S.swap != 0 ) { printf("swap already pending\n"); return(clonestr("{\"error\":\"swap already pending\"}")); } + autxo = LP_utxoadd(0,LP_mypubsock,Q.destcoin,Q.desttxid,Q.destvout,Q.destsatoshis,Q.feetxid,Q.feevout,0,"",Q.destaddr,Q.desthash,LP_gui,G.LP_sessionid); + if ( autxo == 0 ) + { + printf("couldnt create autxo\n"); + return(clonestr("{\"error\":\"couldnt create autxo\"}")); + } if ( (qprice= LP_quote_validate(autxo,butxo,&Q,0)) <= SMALLVAL ) { LP_availableset(autxo);