From 7c52b7fb142fd0254f25ded42bf56e8356c8f6ca Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 25 Feb 2018 22:42:45 +0200 Subject: [PATCH] -prints --- iguana/exchanges/LP_ordermatch.c | 5 ++--- iguana/exchanges/LP_swap.c | 9 ++++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index f487b900c..fe2da5232 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -869,7 +869,6 @@ struct LP_quoteinfo *LP_trades_gotrequest(void *ctx,struct LP_quoteinfo *qp,stru printf("myprice %.8f bid %.8f ask %.8f\n",myprice,bid,ask); return(0); } - printf("myprice %.8f\n",myprice); autxo = &A; butxo = &B; memset(autxo,0,sizeof(*autxo)); @@ -973,7 +972,7 @@ struct LP_quoteinfo *LP_trades_gotrequest(void *ctx,struct LP_quoteinfo *qp,stru printf("i.%d qprice %.8f myprice %.8f price %.8f [%.8f]\n",i,qprice,myprice,price,p); if ( LP_allocated(qp->txid,qp->vout) == 0 && LP_allocated(qp->txid2,qp->vout2) == 0 ) { - printf("found unallocated txids\n"); + //printf("found unallocated txids\n"); reqjson = LP_quotejson(qp); LP_unavailableset(qp->txid,qp->vout,qp->timestamp + LP_RESERVETIME,qp->desthash); LP_unavailableset(qp->txid2,qp->vout2,qp->timestamp + LP_RESERVETIME,qp->desthash); @@ -987,7 +986,7 @@ struct LP_quoteinfo *LP_trades_gotrequest(void *ctx,struct LP_quoteinfo *qp,stru memset(zero.bytes,0,sizeof(zero)); LP_reserved_msg(1,qp->srccoin,qp->destcoin,zero,jprint(reqjson,0)); free_json(reqjson); - printf("Send RESERVED id.%llu\n",(long long)qp->aliceid); + //printf("Send RESERVED id.%llu\n",(long long)qp->aliceid); return(qp); } else printf("request processing selected ineligible utxos?\n"); return(0); diff --git a/iguana/exchanges/LP_swap.c b/iguana/exchanges/LP_swap.c index 756cb9e39..64ac8a3be 100644 --- a/iguana/exchanges/LP_swap.c +++ b/iguana/exchanges/LP_swap.c @@ -612,9 +612,9 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba rawtx->I.redeemlen = recvbuf[offset++]; #ifndef NOTETOMIC uint8arrayToHex(rawtx->I.ethTxid, &recvbuf[offset], 32); + printf("ETH txid received: %s\n", rawtx->I.ethTxid); #endif offset += 32; - printf("ETH txid received: %s\n", rawtx->I.ethTxid); data = &recvbuf[offset]; if ( rawtx->I.redeemlen > 0 && rawtx->I.redeemlen < 0x100 ) { @@ -727,12 +727,15 @@ uint32_t LP_swapdata_rawtxsend(int32_t pairsock,struct basilisk_swap *swap,uint3 sendbuf[sendlen++] = rawtx->I.datalen & 0xff; sendbuf[sendlen++] = (rawtx->I.datalen >> 8) & 0xff; sendbuf[sendlen++] = rawtx->I.redeemlen; - if (rawtx->I.ethTxid[0] != 0 && strlen(rawtx->I.ethTxid) == 66) { + if ( rawtx->I.ethTxid[0] != 0 && strlen(rawtx->I.ethTxid) == 66 ) + { uint8_t ethTxidBytes[32]; // ETH txid always starts with 0x decode_hex(ethTxidBytes, 32, rawtx->I.ethTxid + 2); memcpy(&sendbuf[sendlen], ethTxidBytes, 32); - } else { + } + else + { // fill with zero bytes to always have fixed message size memset(&sendbuf[sendlen], 0, 32); }