Browse Source

Exchange ETH txids.

etomic
Artem Pikulin 7 years ago
parent
commit
dc2de48910
  1. 12
      iguana/exchanges/LP_swap.c

12
iguana/exchanges/LP_swap.c

@ -584,9 +584,6 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba
for (i=0; i<32; i++) for (i=0; i<32; i++)
myhash.bytes[i] = recvbuf[offset++]; myhash.bytes[i] = recvbuf[offset++];
uint8arrayToHex(rawtx->I.ethTxid, &recvbuf[offset], 32);
offset += 32;
printf("ETH txid received: %s", rawtx->I.ethTxid);
offset += iguana_rwnum(0,&recvbuf[offset],sizeof(quoteid),&quoteid); offset += iguana_rwnum(0,&recvbuf[offset],sizeof(quoteid),&quoteid);
offset += iguana_rwnum(0,&recvbuf[offset],sizeof(msgbits),&msgbits); offset += iguana_rwnum(0,&recvbuf[offset],sizeof(msgbits),&msgbits);
datalen = recvbuf[offset++]; datalen = recvbuf[offset++];
@ -597,6 +594,9 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba
return(-1); return(-1);
} }
rawtx->I.redeemlen = recvbuf[offset++]; rawtx->I.redeemlen = recvbuf[offset++];
uint8arrayToHex(rawtx->I.ethTxid, &recvbuf[offset], 32);
offset += 32;
printf("ETH txid received: %s", 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 )
{ {
@ -824,8 +824,6 @@ void LP_bobloop(void *_swap)
} }
if ( error == 0 ) if ( error == 0 )
{
if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x200,data,maxlen,&swap->bobdeposit,0x100,0) != 0 )
{ {
if (swap->I.bobtomic[0] != 0) if (swap->I.bobtomic[0] != 0)
{ {
@ -833,6 +831,10 @@ void LP_bobloop(void *_swap)
strcpy(swap->bobdeposit.I.ethTxid, depositTx); strcpy(swap->bobdeposit.I.ethTxid, depositTx);
free(depositTx); free(depositTx);
} }
if ( LP_swapdata_rawtxsend(swap->N.pair,swap,0x200,data,maxlen,&swap->bobdeposit,0x100,0) != 0 )
{
} }
else else
{ {

Loading…
Cancel
Save