Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
f6a56ffd74
  1. 6
      iguana/swaps/iguana_BTCswap.c

6
iguana/swaps/iguana_BTCswap.c

@ -514,7 +514,7 @@ char *instantdex_BTCswap(struct supernet_info *myinfo,struct exchange_info *exch
minperc = INSTANTDEX_MINPERC; minperc = INSTANTDEX_MINPERC;
if ( swap == 0 && strcmp(cmdstr,"offer") != 0 ) if ( swap == 0 && strcmp(cmdstr,"offer") != 0 )
return(clonestr("{\"error\":\"instantdex_BTCswap no swap info after offer\"}")); 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 ( strcmp(cmdstr,"offer") == 0 && A->info == 0 ) // sender is Bob, receiver is network (Alice)
{ {
if ( A->offer.expiration < (time(NULL) + INSTANTDEX_DURATION) ) if ( A->offer.expiration < (time(NULL) + INSTANTDEX_DURATION) )
@ -536,7 +536,7 @@ char *instantdex_BTCswap(struct supernet_info *myinfo,struct exchange_info *exch
else else
{ {
instantdex_pendingnotice(myinfo,exchange,ap,A); 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); return(retstr);
} }
@ -569,7 +569,7 @@ char *instantdex_BTCswap(struct supernet_info *myinfo,struct exchange_info *exch
else else
{ {
swap->state++; swap->state++;
if ( (retstr= instantdex_choosei(swap,argjson,newjson,serdata,datalen)) != 0 ) if ( (retstr= instantdex_choosei(swap,newjson,argjson,serdata,datalen)) != 0 )
return(retstr); return(retstr);
if ( swap->isbob == 0 ) if ( swap->isbob == 0 )
{ {

Loading…
Cancel
Save