Browse Source

Test

etomic
jl777 8 years ago
parent
commit
31ac3e1e53
  1. 4
      .gitignore
  2. 13
      basilisk/basilisk_swap.c

4
.gitignore

@ -292,3 +292,7 @@ iguana/DB/SWAPS/1192374491-1050242469
iguana/DB/SWAPS/4244307493-1619487751
iguana/DB/SWAPS/3213119432-553439289
iguana/DB/SWAPS/3854521391-612984356
iguana/DB/SWAPS/3611231334-1171171579

13
basilisk/basilisk_swap.c

@ -687,10 +687,19 @@ int32_t basilisk_rawtx_spendscript(struct basilisk_swap *swap,int32_t height,str
void basilisk_swap_coinaddr(struct supernet_info *myinfo,struct basilisk_swap *swap,struct iguana_info *coin,char *coinaddr,uint8_t *data,int32_t datalen)
{
cJSON *txobj; uint8_t extraspace[8192]; bits256 signedtxid; struct iguana_msgtx msgtx; int32_t suppress_pubkeys = 0;
cJSON *txobj,*vouts,*vout,*addresses; uint8_t extraspace[8192]; bits256 signedtxid; struct iguana_msgtx msgtx; char *addr; int32_t n,m,suppress_pubkeys = 0;
if ( (txobj= bitcoin_data2json(coin,coin->longestchain,&signedtxid,&msgtx,extraspace,sizeof(extraspace),data,datalen,0,suppress_pubkeys)) != 0 )
{
char str[65]; printf("got txid.%s (%s)\n",bits256_str(str,signedtxid),jprint(txobj,0));
//char str[65]; printf("got txid.%s (%s)\n",bits256_str(str,signedtxid),jprint(txobj,0));
if ( (vouts= jarray(&n,txobj,"vout")) != 0 && n > 0 )
{
vout = jitem(vouts,0);
if ( (addresses= jarray(&m,vout,"addresses")) != 0 && (addr= jstri(addresses,0)) != 0 )
{
safecopy(coinaddr,addr,64);
printf("extracted.(%s)\n",coinaddr);
}
}
free_json(txobj);
}
}

Loading…
Cancel
Save