Browse Source

Test

etomic
jl777 8 years ago
parent
commit
643e96e337
  1. 2
      iguana/exchanges/LP_swap.c
  2. 10
      iguana/exchanges/LP_transaction.c

2
iguana/exchanges/LP_swap.c

@ -556,7 +556,7 @@ int32_t LP_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,struct ba
{
decode_hex(rawtx->spendscript,hexlen,hexstr);
rawtx->I.spendlen = hexlen;
bitcoin_address(rawtx->p2shaddr,rawtx->coin->taddr,rawtx->coin->p2shtype,rawtx->spendscript,hexlen);
bitcoin_address(rawtx->p2shaddr,rawtx->coin->taddr,rawtx == &swap->otherfee ? rawtx->coin->pubtype : rawtx->coin->p2shtype,rawtx->spendscript,hexlen);
//if ( swap != 0 )
// basilisk_txlog(swap->myinfoptr,swap,rawtx,-1); // bobdeposit, bobpayment or alicepayment
retval = 0;

10
iguana/exchanges/LP_transaction.c

@ -1331,10 +1331,12 @@ int32_t LP_verify_otherfee(struct basilisk_swap *swap,uint8_t *data,int32_t data
{
if ( LP_rawtx_spendscript(swap,swap->bobcoin.longestchain,&swap->otherfee,0,data,datalen,0) == 0 )
{
printf("amount %.8f -> %s\n",dstr(swap->otherfee.I.amount),swap->otherfee.p2shaddr);
//memcpy(swap->otherfee.txbytes,data,datalen);
//swap->otherfee.I.datalen = datalen;
//swap->otherfee.I.actualtxid = swap->otherfee.I.signedtxid = bits256_doublesha256(0,data,datalen);
printf("otherfee amount %.8f -> %s vs %s\n",dstr(swap->otherfee.I.amount),swap->otherfee.p2shaddr,swap->otherfee.I.destaddr);
if ( strcmp(swap->otherfee.I.destaddr,swap->otherfee.p2shaddr) == 0 )
{
printf("dexfee verified\n");
return(0);
}
}
return(0);
}

Loading…
Cancel
Save