|
|
@ -866,9 +866,12 @@ int32_t basilisk_swapget(struct supernet_info *myinfo,struct basilisk_swap *swap |
|
|
|
|
|
|
|
uint32_t basilisk_swapsend(struct supernet_info *myinfo,struct basilisk_swap *swap,uint32_t msgbits,uint8_t *data,int32_t datalen,uint32_t nextbits,uint32_t crcs[2]) |
|
|
|
{ |
|
|
|
basilisk_channelsend(myinfo,swap->I.myhash,swap->I.otherhash,swap->I.req.quoteid,msgbits,data,datalen,INSTANTDEX_LOCKTIME*2); |
|
|
|
if ( basilisk_crcsend(myinfo,0,swap->verifybuf,sizeof(swap->verifybuf),swap->I.myhash,swap->I.otherhash,swap->I.req.quoteid,msgbits,data,datalen,crcs) != 0 ) |
|
|
|
{ |
|
|
|
if ( (rand() % 10) == 0 ) |
|
|
|
basilisk_channelsend(myinfo,swap->I.myhash,swap->I.otherhash,swap->I.req.quoteid,msgbits,data,datalen,INSTANTDEX_LOCKTIME*2); |
|
|
|
return(nextbits); |
|
|
|
} |
|
|
|
else return(0); |
|
|
|
} |
|
|
|
|
|
|
@ -1730,8 +1733,8 @@ void basilisk_swaploop(void *_swap) |
|
|
|
break; |
|
|
|
} |
|
|
|
sleep(3 + (swap->I.iambob == 0)*1); |
|
|
|
dpow_nanomsg_update(myinfo); |
|
|
|
dex_updateclient(myinfo); |
|
|
|
//dpow_nanomsg_update(myinfo);
|
|
|
|
//dex_updateclient(myinfo);
|
|
|
|
} |
|
|
|
if ( time(NULL) >= expiration ) |
|
|
|
retval = -1; |
|
|
@ -1739,8 +1742,8 @@ void basilisk_swaploop(void *_swap) |
|
|
|
printf("C r%u/q%u swapstate.%x\n",swap->I.req.requestid,swap->I.req.quoteid,swap->I.statebits); |
|
|
|
while ( retval == 0 && (swap->I.statebits & 0x40) == 0 ) // send fee
|
|
|
|
{ |
|
|
|
dpow_nanomsg_update(myinfo); |
|
|
|
dex_updateclient(myinfo); |
|
|
|
//dpow_nanomsg_update(myinfo);
|
|
|
|
//dex_updateclient(myinfo);
|
|
|
|
basilisk_sendstate(myinfo,swap,data,maxlen); |
|
|
|
basilisk_swapget(myinfo,swap,0x80000000,data,maxlen,basilisk_verify_otherstatebits); |
|
|
|
if ( swap->myfee.txbytes == 0 ) |
|
|
@ -1824,8 +1827,8 @@ void basilisk_swaploop(void *_swap) |
|
|
|
basilisk_swapget(myinfo,swap,0x80000000,data,maxlen,basilisk_verify_otherstatebits); |
|
|
|
if ( time(NULL) > swap->I.expiration ) |
|
|
|
break; |
|
|
|
dpow_nanomsg_update(myinfo); |
|
|
|
dex_updateclient(myinfo); |
|
|
|
//dpow_nanomsg_update(myinfo);
|
|
|
|
//dex_updateclient(myinfo);
|
|
|
|
} |
|
|
|
printf("end of atomic swap\n"); |
|
|
|
if ( swap->I.iambob != 0 && swap->bobdeposit.txbytes != 0 ) |
|
|
|