|
|
@ -528,6 +528,13 @@ void basilisk_swaploop(void *_swap) |
|
|
|
#ifndef __APPLE__ |
|
|
|
getchar(); |
|
|
|
#endif |
|
|
|
if ( bitcoin_swapinit(myinfo,swap) == 0 ) |
|
|
|
{ |
|
|
|
printf("bitcoin_swapinit error\n"); |
|
|
|
return; |
|
|
|
} |
|
|
|
printf("back from swapinit\n"); |
|
|
|
|
|
|
|
maxlen = sizeof(*swap); |
|
|
|
data = malloc(maxlen); |
|
|
|
while ( time(NULL) < swap->expiration ) |
|
|
@ -715,12 +722,8 @@ struct basilisk_swap *basilisk_thread_start(struct supernet_info *myinfo,struct |
|
|
|
swap->req = *rp; |
|
|
|
swap->myinfo = myinfo; |
|
|
|
printf("START swap requestid.%u\n",rp->requestid); |
|
|
|
if ( bitcoin_swapinit(myinfo,swap) != 0 ) |
|
|
|
{ |
|
|
|
printf("back from swapinit\n"); |
|
|
|
myinfo->swaps[myinfo->numswaps++] = swap; |
|
|
|
iguana_launch(iguana_coinfind("BTCD"),"basilisk_swaploop",basilisk_swaploop,swap,IGUANA_PERMTHREAD); |
|
|
|
} else free(swap), swap = 0; |
|
|
|
myinfo->swaps[myinfo->numswaps++] = swap; |
|
|
|
iguana_launch(iguana_coinfind("BTCD"),"basilisk_swaploop",basilisk_swaploop,swap,IGUANA_PERMTHREAD); |
|
|
|
} |
|
|
|
portable_mutex_unlock(&myinfo->DEX_swapmutex); |
|
|
|
return(swap); |
|
|
|