Browse Source

-prints

patch-3
jl777 7 years ago
parent
commit
7c52b7fb14
  1. 5
      iguana/exchanges/LP_ordermatch.c
  2. 9
      iguana/exchanges/LP_swap.c

5
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); printf("myprice %.8f bid %.8f ask %.8f\n",myprice,bid,ask);
return(0); return(0);
} }
printf("myprice %.8f\n",myprice);
autxo = &A; autxo = &A;
butxo = &B; butxo = &B;
memset(autxo,0,sizeof(*autxo)); 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); 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 ) 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); reqjson = LP_quotejson(qp);
LP_unavailableset(qp->txid,qp->vout,qp->timestamp + LP_RESERVETIME,qp->desthash); LP_unavailableset(qp->txid,qp->vout,qp->timestamp + LP_RESERVETIME,qp->desthash);
LP_unavailableset(qp->txid2,qp->vout2,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)); memset(zero.bytes,0,sizeof(zero));
LP_reserved_msg(1,qp->srccoin,qp->destcoin,zero,jprint(reqjson,0)); LP_reserved_msg(1,qp->srccoin,qp->destcoin,zero,jprint(reqjson,0));
free_json(reqjson); 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); return(qp);
} else printf("request processing selected ineligible utxos?\n"); } else printf("request processing selected ineligible utxos?\n");
return(0); return(0);

9
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++]; rawtx->I.redeemlen = recvbuf[offset++];
#ifndef NOTETOMIC #ifndef NOTETOMIC
uint8arrayToHex(rawtx->I.ethTxid, &recvbuf[offset], 32); uint8arrayToHex(rawtx->I.ethTxid, &recvbuf[offset], 32);
printf("ETH txid received: %s\n", rawtx->I.ethTxid);
#endif #endif
offset += 32; offset += 32;
printf("ETH txid received: %s\n", rawtx->I.ethTxid);
data = &recvbuf[offset]; data = &recvbuf[offset];
if ( rawtx->I.redeemlen > 0 && rawtx->I.redeemlen < 0x100 ) 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 & 0xff;
sendbuf[sendlen++] = (rawtx->I.datalen >> 8) & 0xff; sendbuf[sendlen++] = (rawtx->I.datalen >> 8) & 0xff;
sendbuf[sendlen++] = rawtx->I.redeemlen; 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]; uint8_t ethTxidBytes[32];
// ETH txid always starts with 0x // ETH txid always starts with 0x
decode_hex(ethTxidBytes, 32, rawtx->I.ethTxid + 2); decode_hex(ethTxidBytes, 32, rawtx->I.ethTxid + 2);
memcpy(&sendbuf[sendlen], ethTxidBytes, 32); memcpy(&sendbuf[sendlen], ethTxidBytes, 32);
} else { }
else
{
// fill with zero bytes to always have fixed message size // fill with zero bytes to always have fixed message size
memset(&sendbuf[sendlen], 0, 32); memset(&sendbuf[sendlen], 0, 32);
} }

Loading…
Cancel
Save