diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 9208a6006..ca22231aa 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -79,6 +79,11 @@ cJSON *LP_quotejson(struct LP_quoteinfo *qp) jaddbits256(retjson,"desttxid",qp->desttxid); jaddnum(retjson,"destvout",qp->destvout); } + if ( bits256_nonz(qp->feetxid) != 0 ) + { + jaddbits256(retjson,"feetxid",qp->feetxid); + jaddnum(retjson,"feevout",qp->feevout); + } if ( qp->destsatoshis != 0 ) jadd64bits(retjson,"destsatoshis",qp->destsatoshis); if ( qp->desttxfee != 0 ) @@ -100,8 +105,10 @@ int32_t LP_quoteparse(struct LP_quoteinfo *qp,cJSON *argjson) qp->txid2 = jbits256(argjson,"txid2"); qp->vout = jint(argjson,"vout"); qp->vout2 = jint(argjson,"vout2"); + qp->feevout = jint(argjson,"feevout"); qp->srchash = jbits256(argjson,"srchash"); qp->desttxid = jbits256(argjson,"desttxid"); + qp->feetxid = jbits256(argjson,"feetxid"); qp->destvout = jint(argjson,"destvout"); qp->desthash = jbits256(argjson,"desthash"); if ( (qp->satoshis= j64bits(argjson,"satoshis")) == 0 ) @@ -327,6 +334,8 @@ cJSON *LP_bestprice(struct LP_utxoinfo *myutxo,char *base) i = besti; Q[i].desttxid = myutxo->txid; Q[i].destvout = myutxo->vout; + Q[i].feetxid = myutxo->txid2; + Q[i].feevout = myutxo->vout2; strcpy(Q[i].destaddr,myutxo->coinaddr); price = LP_query("request",&Q[i],jstr(item,"ipaddr"),jint(item,"port"),base,myutxo->coin,myutxo->mypub); if ( jobj(bestitem,"price") != 0 ) @@ -336,6 +345,8 @@ cJSON *LP_bestprice(struct LP_utxoinfo *myutxo,char *base) { Q[i].desttxid = myutxo->txid; Q[i].destvout = myutxo->vout; + Q[i].feetxid = myutxo->txid2; + Q[i].feevout = myutxo->vout2; strcpy(Q[i].destaddr,myutxo->coinaddr); price = LP_query("connect",&Q[i],jstr(item,"ipaddr"),jint(item,"port"),base,myutxo->coin,myutxo->mypub); LP_requestinit(&R,Q[i].srchash,Q[i].desthash,base,Q[i].satoshis,Q[i].destcoin,Q[i].destsatoshis,Q[i].timestamp,Q[i].quotetime,DEXselector); diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index a7ec599ed..5ee18b1a7 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -202,9 +202,9 @@ struct basilisk_swap struct LP_quoteinfo { struct basilisk_request R; - bits256 srchash,desthash,txid,txid2,desttxid,privkey; + bits256 srchash,desthash,txid,txid2,desttxid,feetxid,privkey; uint64_t satoshis,satoshis2,txfee,destsatoshis,desttxfee,change; - uint32_t timestamp,quotetime; int32_t vout,vout2,destvout,pair; + uint32_t timestamp,quotetime; int32_t vout,vout2,destvout,feevout,pair; char srccoin[16],coinaddr[64],destcoin[16],destaddr[64]; }; diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index c901bf1aa..7000057d5 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -214,8 +214,8 @@ char *LP_signrawtx(char *symbol,bits256 *signedtxidp,int32_t *completedp,cJSON * data = malloc(len >> 1); decode_hex(data,len>>1,hexstr); *signedtxidp = bits256_doublesha256(0,data,len >> 1); - printf("%s signrawtransaction.(%s) params.(%s) -> \nsignedtx.(%s)\n",coin->symbol,retstr,paramstr,signedtx); } + else printf("%s signrawtransaction.(%s) params.(%s)\n",coin->symbol,retstr,paramstr); free_json(json); } free(retstr); diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 3837d1b7b..92db527c8 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -410,7 +410,7 @@ int32_t LP_mostprivs_verify(struct basilisk_swap *swap,uint8_t *data,int32_t dat swap->I.secretAm[i] = data[len++]; for (i=0; i<32; i++) swap->I.secretAm256[i] = data[len++]; - basilisk_bobscripts_set(swap,1,1); + //basilisk_bobscripts_set(swap,1,1); } else { @@ -999,6 +999,9 @@ struct basilisk_swap *LP_swapinit(int32_t iambob,int32_t optionduration,bits256 swap->bobpayment.utxotxid = qp->txid, swap->bobpayment.utxovout = qp->vout; swap->bobdeposit.utxotxid = qp->txid2, swap->bobdeposit.utxovout = qp->vout2; swap->alicepayment.utxotxid = qp->desttxid, swap->alicepayment.utxovout = qp->destvout; + if ( iambob != 0 ) + swap->otherfee.utxotxid = qp->feetxid, swap->otherfee.utxovout = qp->feevout; + else swap->myfee.utxotxid = qp->feetxid, swap->myfee.utxovout = qp->feevout; return(swap); }