|
|
@ -965,13 +965,10 @@ struct LP_quoteinfo *LP_trades_gotconnect(void *ctx,struct LP_quoteinfo *qp,stru |
|
|
|
qp = newqp; |
|
|
|
if ( (coin= LP_coinfind(qp->srccoin)) == 0 ) |
|
|
|
return(0); |
|
|
|
printf("check myprice\n"); |
|
|
|
if ( (myprice= LP_trades_bobprice(&bid,&ask,qp)) == 0. ) |
|
|
|
return(0); |
|
|
|
printf("validate myprice\n"); |
|
|
|
if ( (qprice= LP_trades_pricevalidate(qp,coin,myprice)) < 0. ) |
|
|
|
return(0); |
|
|
|
printf("check reservation\n"); |
|
|
|
if ( LP_reservation_check(qp->txid,qp->vout,qp->desthash) == 0 && LP_reservation_check(qp->txid2,qp->vout2,qp->desthash) == 0 ) |
|
|
|
{ |
|
|
|
printf("CONNECT STARTBOB!\n"); |
|
|
@ -984,12 +981,12 @@ struct LP_quoteinfo *LP_trades_gotconnect(void *ctx,struct LP_quoteinfo *qp,stru |
|
|
|
struct LP_quoteinfo *LP_trades_gotconnected(void *ctx,struct LP_quoteinfo *qp,struct LP_quoteinfo *newqp,char *pairstr) |
|
|
|
{ |
|
|
|
char *retstr; |
|
|
|
//char str[65]; printf("alice %s received CONNECTED.(%llu)\n",bits256_str(str,G.LP_mypub25519),(long long)qp->aliceid);
|
|
|
|
char str[65]; printf("alice %s received CONNECTED.(%llu)\n",bits256_str(str,G.LP_mypub25519),(long long)qp->aliceid); |
|
|
|
*newqp = *qp; |
|
|
|
qp = newqp; |
|
|
|
if ( LP_trades_alicevalidate(ctx,qp) > 0. ) |
|
|
|
{ |
|
|
|
//printf("LP_trades_alicevalidate fine\n");
|
|
|
|
printf("CONNECTED ALICE\n"); |
|
|
|
LP_aliceid(qp->tradeid,qp->aliceid,"connected",0,0); |
|
|
|
if ( (retstr= LP_connectedalice(qp,pairstr)) != 0 ) |
|
|
|
free(retstr); |
|
|
|