Browse Source

Test

etomic
jl777 7 years ago
parent
commit
120c0ed44d
  1. 11
      iguana/exchanges/LP_remember.c
  2. 3
      iguana/exchanges/LP_transaction.c

11
iguana/exchanges/LP_remember.c

@ -1036,23 +1036,28 @@ cJSON *basilisk_remember(int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requesti
{
if ( time(NULL) > rswap.expiration+777 )
{
printf("alice tries to claim bobdeposit\n");
flag = 0;
if ( bob->electrum == 0 )
{
if ( (txoutobj= LP_gettxout(rswap.bobcoin,rswap.bobdepositaddr,rswap.txids[BASILISK_BOBDEPOSIT],0)) != 0 )
free_json(txoutobj), flag = 0;
else flag = -1, rswap.depositspent = deadtxid;
}
printf("native mode flag.%d\n",flag);
} else printf("SPV mode\n");
if ( flag == 0 )
{
if ( rswap.Dredeemlen != 0 )
redeemlen = rswap.Dredeemlen, memcpy(redeemscript,rswap.Dredeemscript,rswap.Dredeemlen);
else redeemlen = basilisk_swap_bobredeemscript(1,&secretstart,redeemscript,rswap.dlocktime,rswap.pubA0,rswap.pubB0,rswap.pubB1,rswap.privAm,zero,rswap.secretAm,rswap.secretAm256,rswap.secretBn,rswap.secretBn256);
printf("redeemlen.%d\n",redeemlen);
if ( redeemlen > 0 )
{
if ( bits256_nonz(rswap.privBn) == 0 )
/*if ( bits256_nonz(rswap.privBn) == 0 )
{
rswap.privBn = basilisk_swap_privBn_extract(&rswap.txids[BASILISK_BOBREFUND],rswap.bobcoin,rswap.txids[BASILISK_BOBDEPOSIT],rswap.privBn);
if ( bits256_nonz(rswap.privBn) != 0 )
}
if ( bits256_nonz(rswap.privBn) != 0 )*/
{
len = basilisk_swapuserdata(userdata,zero,1,rswap.myprivs[0],redeemscript,redeemlen);
if ( (rswap.txbytes[BASILISK_ALICECLAIM]= basilisk_swap_bobtxspend(&signedtxid,rswap.Btxfee,"aliceclaim",rswap.bobcoin,bob->wiftaddr,bob->taddr,bob->pubtype,bob->p2shtype,bob->isPoS,bob->wiftype,ctx,rswap.myprivs[0],0,redeemscript,redeemlen,userdata,len,rswap.txids[BASILISK_BOBDEPOSIT],0,0,rswap.pubkey33,0,rswap.expiration,&rswap.values[BASILISK_ALICECLAIM],0,0,rswap.bobdepositaddr,1,bob->zcash)) != 0 )

3
iguana/exchanges/LP_transaction.c

@ -1646,10 +1646,11 @@ bits256 LP_swap_spendtxid(char *symbol,char *destaddr,bits256 utxotxid,int32_t u
memset(&spendtxid,0,sizeof(spendtxid));
if ( LP_spendsearch(destaddr,&spendtxid,&spendvin,symbol,utxotxid,utxovout) > 0 )
{
//char str[65]; printf("spend of %s/v%d detected\n",bits256_str(str,utxotxid),utxovout);
char str[65]; printf("%s dest.%s spend of %s/v%d detected\n",symbol,destaddr,bits256_str(str,utxotxid),utxovout);
}
else if ( (coin= LP_coinfind(symbol)) != 0 && coin->electrum == 0 )
{
printf("get received by %s\n",destaddr);
if ( (array= LP_listreceivedbyaddress(symbol,destaddr)) != 0 )
{
if ( (n= cJSON_GetArraySize(array)) > 0 )

Loading…
Cancel
Save