|
|
@ -514,7 +514,7 @@ char *instantdex_BTCswap(struct supernet_info *myinfo,struct exchange_info *exch |
|
|
|
minperc = INSTANTDEX_MINPERC; |
|
|
|
if ( swap == 0 && strcmp(cmdstr,"offer") != 0 ) |
|
|
|
return(clonestr("{\"error\":\"instantdex_BTCswap no swap info after offer\"}")); |
|
|
|
printf("T.%d [%d] got offer.(%s/%s) %.8f vol %.8f %llu offerside.%d offerdir.%d swap.%p decksize.%ld\n",bits256_cmp(traderpub,myinfo->myaddr.persistent),swap!=0?swap->state:-1,A->offer.base,A->offer.rel,dstr(A->offer.price64),dstr(A->offer.basevolume64),(long long)A->orderid,A->offer.myside,A->offer.acceptdir,A->info,sizeof(swap->deck)); |
|
|
|
printf("T.%d [%d] got offer.(%s/%s) %.8f vol %.8f %llu offerside.%d offerdir.%d swap.%p decksize.%ld %s\n",bits256_cmp(traderpub,myinfo->myaddr.persistent),swap!=0?swap->state:-1,A->offer.base,A->offer.rel,dstr(A->offer.price64),dstr(A->offer.basevolume64),(long long)A->orderid,A->offer.myside,A->offer.acceptdir,A->info,sizeof(swap->deck),jprint(argjson,0)); |
|
|
|
if ( strcmp(cmdstr,"offer") == 0 && A->info == 0 ) // sender is Bob, receiver is network (Alice)
|
|
|
|
{ |
|
|
|
if ( A->offer.expiration < (time(NULL) + INSTANTDEX_DURATION) ) |
|
|
@ -536,7 +536,7 @@ char *instantdex_BTCswap(struct supernet_info *myinfo,struct exchange_info *exch |
|
|
|
else |
|
|
|
{ |
|
|
|
instantdex_pendingnotice(myinfo,exchange,ap,A); |
|
|
|
if ( (retstr= instantdex_choosei(swap,argjson,newjson,serdata,datalen)) != 0 ) |
|
|
|
if ( (retstr= instantdex_choosei(swap,newjson,argjson,serdata,datalen)) != 0 ) |
|
|
|
{ |
|
|
|
return(retstr); |
|
|
|
} |
|
|
@ -569,7 +569,7 @@ char *instantdex_BTCswap(struct supernet_info *myinfo,struct exchange_info *exch |
|
|
|
else |
|
|
|
{ |
|
|
|
swap->state++; |
|
|
|
if ( (retstr= instantdex_choosei(swap,argjson,newjson,serdata,datalen)) != 0 ) |
|
|
|
if ( (retstr= instantdex_choosei(swap,newjson,argjson,serdata,datalen)) != 0 ) |
|
|
|
return(retstr); |
|
|
|
if ( swap->isbob == 0 ) |
|
|
|
{ |
|
|
|