Browse Source

Test

etomic
jl777 8 years ago
parent
commit
b61f6d821b
  1. 2
      .gitignore
  2. 19
      basilisk/basilisk_DEX.c
  3. 4
      basilisk/basilisk_swap.c

2
.gitignore

@ -348,3 +348,5 @@ iguana/DB/SWAPS/61119357-1960547076
iguana/DB/SWAPS/26534791-3105729230 iguana/DB/SWAPS/26534791-3105729230
*.finished *.finished
iguana/DB/SWAPS/2279906047-2580050792

19
basilisk/basilisk_DEX.c

@ -484,7 +484,7 @@ char *basilisk_respond_accept(struct supernet_info *myinfo,bits256 privkey,uint3
cJSON *basilisk_unspents(struct supernet_info *myinfo,struct iguana_info *coin,char *coinaddr) cJSON *basilisk_unspents(struct supernet_info *myinfo,struct iguana_info *coin,char *coinaddr)
{ {
cJSON *unspents=0,*array=0; char *retstr; cJSON *unspents=0,*array=0,*json,*ismine; char *retstr; int32_t valid = 0;
if ( coin->FULLNODE > 0 ) if ( coin->FULLNODE > 0 )
{ {
array = cJSON_CreateArray(); array = cJSON_CreateArray();
@ -492,15 +492,24 @@ cJSON *basilisk_unspents(struct supernet_info *myinfo,struct iguana_info *coin,c
unspents = iguana_listunspents(myinfo,coin,array,0,0,""); unspents = iguana_listunspents(myinfo,coin,array,0,0,"");
free_json(array); free_json(array);
} }
else if ( coin->FULLNODE == 0 ) else
{ {
if ( (retstr= dex_listunspent(myinfo,coin,0,0,coin->symbol,coinaddr)) != 0 ) if ( coin->FULLNODE < 0 && (retstr= dpow_validateaddress(myinfo,coin,coinaddr)) != 0 )
{ {
unspents = cJSON_Parse(retstr); json = cJSON_Parse(retstr);
if ( (ismine= jobj(json,"ismine")) != 0 && is_cJSON_True(ismine) != 0 )
valid = 1;
free(retstr); free(retstr);
} }
if ( coin->FULLNODE == 0 || valid == 0 )
{
if ( (retstr= dex_listunspent(myinfo,coin,0,0,coin->symbol,coinaddr)) != 0 )
{
unspents = cJSON_Parse(retstr);
free(retstr);
}
} else unspents = dpow_listunspent(myinfo,coin,coinaddr);
} }
else unspents = dpow_listunspent(myinfo,coin,coinaddr);
return(unspents); return(unspents);
} }

4
basilisk/basilisk_swap.c

@ -567,11 +567,11 @@ int32_t _basilisk_rawtx_gen(char *str,struct supernet_info *myinfo,uint32_t swap
jaddistr(addresses,coinaddr); jaddistr(addresses,coinaddr);
jadd(valsobj,"addresses",addresses); jadd(valsobj,"addresses",addresses);
rawtx->I.locktime = locktime; rawtx->I.locktime = locktime;
//printf("%s locktime.%u\n",rawtx->name,locktime); printf("%s locktime.%u\n",rawtx->name,locktime);
V = calloc(256,sizeof(*V)); V = calloc(256,sizeof(*V));
if ( (retstr= basilisk_bitcoinrawtx(myinfo,rawtx->coin,"",basilisktag,jint(valsobj,"timeout"),valsobj,V)) != 0 ) if ( (retstr= basilisk_bitcoinrawtx(myinfo,rawtx->coin,"",basilisktag,jint(valsobj,"timeout"),valsobj,V)) != 0 )
{ {
//printf("%s %s basilisk_bitcoinrawtx.(%s)\n",rawtx->name,str,retstr); printf("%s %s basilisk_bitcoinrawtx.(%s)\n",rawtx->name,str,retstr);
flag = 0; flag = 0;
if ( (retarray= cJSON_Parse(retstr)) != 0 ) if ( (retarray= cJSON_Parse(retstr)) != 0 )
{ {

Loading…
Cancel
Save