diff --git a/.gitignore b/.gitignore index 0b111b91f..98ef5aaac 100755 --- a/.gitignore +++ b/.gitignore @@ -348,3 +348,5 @@ iguana/DB/SWAPS/61119357-1960547076 iguana/DB/SWAPS/26534791-3105729230 *.finished + +iguana/DB/SWAPS/2279906047-2580050792 diff --git a/basilisk/basilisk_DEX.c b/basilisk/basilisk_DEX.c index 9ba81fccc..b1e6fb579 100755 --- a/basilisk/basilisk_DEX.c +++ b/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 *unspents=0,*array=0; char *retstr; + cJSON *unspents=0,*array=0,*json,*ismine; char *retstr; int32_t valid = 0; if ( coin->FULLNODE > 0 ) { 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,""); 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); } + 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); } diff --git a/basilisk/basilisk_swap.c b/basilisk/basilisk_swap.c index f5d50a733..2bc5fa486 100755 --- a/basilisk/basilisk_swap.c +++ b/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); jadd(valsobj,"addresses",addresses); 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)); 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; if ( (retarray= cJSON_Parse(retstr)) != 0 ) {