|
|
@ -1013,7 +1013,7 @@ void LP_tradesloop(void *ctx) |
|
|
|
now = (uint32_t)time(NULL); |
|
|
|
Q = qtp->Q; |
|
|
|
funcid = qtp->funcid; |
|
|
|
printf("dequeue %p funcid.%d aliceid.%llu iambob.%d\n",qtp,funcid,(long long)qtp->aliceid,qtp->iambob); |
|
|
|
//printf("dequeue %p funcid.%d aliceid.%llu iambob.%d\n",qtp,funcid,(long long)qtp->aliceid,qtp->iambob);
|
|
|
|
portable_mutex_lock(&LP_tradesmutex); |
|
|
|
DL_DELETE(LP_tradesQ,qtp); |
|
|
|
HASH_FIND(hh,LP_trades,&qtp->aliceid,sizeof(qtp->aliceid),tp); |
|
|
@ -1041,7 +1041,7 @@ printf("dequeue %p funcid.%d aliceid.%llu iambob.%d\n",qtp,funcid,(long long)qtp |
|
|
|
{ |
|
|
|
flag = 1; |
|
|
|
tp->negotiationdone = now; |
|
|
|
printf("bob sets negotiationdone.%u\n",now); |
|
|
|
//printf("bob sets negotiationdone.%u\n",now);
|
|
|
|
LP_trades_gotconnect(ctx,&tp->Q,&tp->Qs[LP_CONNECT],tp->pairstr); |
|
|
|
} |
|
|
|
} |
|
|
@ -1054,10 +1054,7 @@ printf("dequeue %p funcid.%d aliceid.%llu iambob.%d\n",qtp,funcid,(long long)qtp |
|
|
|
//printf("finished dequeue %p funcid.%d aliceid.%llu iambob.%d\n",qtp,funcid,(long long)qtp->aliceid,qtp->iambob);
|
|
|
|
free(qtp); |
|
|
|
if ( tp->negotiationdone != 0 ) |
|
|
|
{ |
|
|
|
printf("iambob.%d negotiationdone.%u\n",tp->iambob,tp->negotiationdone); |
|
|
|
continue; |
|
|
|
} |
|
|
|
flag = 0; |
|
|
|
if ( qtp->iambob == tp->iambob ) |
|
|
|
{ |
|
|
@ -1081,7 +1078,7 @@ printf("dequeue %p funcid.%d aliceid.%llu iambob.%d\n",qtp,funcid,(long long)qtp |
|
|
|
{ |
|
|
|
flag = 1; |
|
|
|
tp->negotiationdone = now; |
|
|
|
printf("bob sets negotiationdone.%u\n",now); |
|
|
|
//printf("bob sets negotiationdone.%u\n",now);
|
|
|
|
LP_trades_gotconnect(ctx,&tp->Q,&tp->Qs[LP_CONNECT],tp->pairstr); |
|
|
|
} |
|
|
|
} |
|
|
|