Browse Source

Gui string

beta
jl777 7 years ago
parent
commit
a969ae6c9d
  1. 2
      iguana/exchanges/LP_include.h
  2. 14
      iguana/exchanges/LP_nativeDEX.c
  3. 2
      iguana/exchanges/LP_signatures.c

2
iguana/exchanges/LP_include.h

@ -252,7 +252,7 @@ struct LP_quoteinfo
bits256 srchash,desthash,txid,txid2,desttxid,feetxid,privkey;
uint64_t satoshis,txfee,destsatoshis,desttxfee;
uint32_t timestamp,quotetime; int32_t vout,vout2,destvout,feevout,pair;
char srccoin[16],coinaddr[64],destcoin[16],destaddr[64];
char srccoin[16],coinaddr[64],destcoin[16],destaddr[64],gui[64];
};
struct LP_endpoint { int32_t pair; char ipaddr[64]; uint16_t port; };

14
iguana/exchanges/LP_nativeDEX.c

@ -299,10 +299,6 @@ int32_t LP_nanomsg_recvs(void *ctx)
int32_t nonz = 0; char *origipaddr; struct LP_peerinfo *peer,*tmp; double milli;
if ( (origipaddr= LP_myipaddr) == 0 )
origipaddr = "127.0.0.1";
milli = OS_milliseconds();
if ( lastmilli > 0. && milli > lastmilli+3000 )
fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",milli-lastmilli,LP_lastcommand!=0?LP_lastcommand:"");
lastmilli = milli;
//portable_mutex_lock(&LP_nanorecvsmutex);
HASH_ITER(hh,LP_peerinfos,peer,tmp)
{
@ -317,7 +313,11 @@ int32_t LP_nanomsg_recvs(void *ctx)
}
}
//printf("check %s pubsock.%d\n",peer->ipaddr,peer->subsock);
milli = OS_milliseconds();
nonz += LP_sock_check("PULL",ctx,origipaddr,LP_mypubsock,peer->subsock,peer->ipaddr,1);
if ( lastmilli > 0. && milli > lastmilli+1000 )
fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",milli-lastmilli,LP_lastcommand!=0?LP_lastcommand:"");
lastmilli = milli;
}
/*HASH_ITER(hh,LP_coins,coin,ctmp) // firstrefht,firstscanht,lastscanht
{
@ -327,7 +327,13 @@ int32_t LP_nanomsg_recvs(void *ctx)
nonz += LP_sock_check(coin->symbol,ctx,origipaddr,-1,coin->bussock,LP_profitratio - 1.);
}*/
if ( LP_mypullsock >= 0 )
{
milli = OS_milliseconds();
nonz += LP_sock_check("SUB",ctx,origipaddr,-1,LP_mypullsock,"127.0.0.1",1);
if ( lastmilli > 0. && milli > lastmilli+1000 )
fprintf(stderr,">>>>>>>>>>>>>>>>> BIG latency lag %.3f milliseconds: (%s)\n",milli-lastmilli,LP_lastcommand!=0?LP_lastcommand:"");
lastmilli = milli;
}
//portable_mutex_unlock(&LP_nanorecvsmutex);
return(nonz);
}

2
iguana/exchanges/LP_signatures.c

@ -42,6 +42,7 @@ struct basilisk_request *LP_requestinit(struct basilisk_request *rp,bits256 srch
cJSON *LP_quotejson(struct LP_quoteinfo *qp)
{
double price; cJSON *retjson = cJSON_CreateObject();
jaddstr(retjson,"gui",qp->gui[0] != 0 ? qp->gui : LP_gui);
jaddstr(retjson,"base",qp->srccoin);
jaddstr(retjson,"rel",qp->destcoin);
if ( qp->coinaddr[0] != 0 )
@ -96,6 +97,7 @@ cJSON *LP_quotejson(struct LP_quoteinfo *qp)
int32_t LP_quoteparse(struct LP_quoteinfo *qp,cJSON *argjson)
{
safecopy(qp->gui,LP_gui,sizeof(qp->gui));
safecopy(qp->srccoin,jstr(argjson,"base"),sizeof(qp->srccoin));
safecopy(qp->coinaddr,jstr(argjson,"address"),sizeof(qp->coinaddr));
safecopy(qp->destcoin,jstr(argjson,"rel"),sizeof(qp->destcoin));

Loading…
Cancel
Save