Browse Source

Test

etomic
jl777 7 years ago
parent
commit
f1a4e490c5
  1. 2
      iguana/exchanges/LP_include.h
  2. 5
      iguana/exchanges/LP_nativeDEX.c
  3. 6
      iguana/exchanges/LP_zeroconf.c
  4. 3
      iguana/exchanges/stats.c

2
iguana/exchanges/LP_include.h

@ -273,7 +273,7 @@ struct iguana_info
portable_mutex_t txmutex,addrmutex; struct LP_transaction *transactions; struct LP_address *addresses;
uint64_t txfee;
int32_t numutxos,longestchain,firstrefht,firstscanht,lastscanht,bussock,height; uint16_t busport;
uint32_t loadedcache,electrumlist,lastunspent,importedprivkey,lastpushtime,lastutxosync,addr_listunspent_requested,lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,obooktime;
uint32_t loadedcache,electrumlist,lastunspent,importedprivkey,lastpushtime,lastutxosync,addr_listunspent_requested,lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,obooktime,electrumzeroconf;
uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag,userconfirms,isassetchain,maxconfirms;
char symbol[128],smartaddr[64],userpass[1024],serverport[128];
// portfolio

5
iguana/exchanges/LP_nativeDEX.c

@ -555,6 +555,11 @@ void LP_coinsloop(void *_coins)
coin->longestchain = LP_getheight(coin);
if ( (ep= coin->electrum) != 0 )
{
if ( strcmp("KMD",coin->symbol) == 0 && coin->electrumzeroconf == 0 )
{
LP_zeroconf_deposits(coin);
coin->electrumzeroconf = (uint32_t)time(NULL);
}
if ( (backupep= ep->prev) == 0 )
backupep = ep;
if ( (ap= LP_addressfind(coin,coin->smartaddr)) != 0 )

6
iguana/exchanges/LP_zeroconf.c

@ -196,7 +196,7 @@ void LP_zeroconf_credit(char *coinaddr,uint64_t satoshis,int32_t weeki,char *p2s
if ( coin != 0 )
{
timestamp = LP_FIRSTWEEKTIME + weeki*LP_WEEKMULT;
if ( (ap= LP_address(coin,coinaddr)) != 0 ) //time(NULL) < timestamp-24*3600 &&
if ( time(NULL) < timestamp-24*3600 && (ap= LP_address(coin,coinaddr)) != 0 )
{
ap->zeroconf_credits += satoshis;
printf("ZEROCONF credit.(%s) %.8f weeki.%d (%s) -> sum %.8f\n",coinaddr,dstr(satoshis),weeki,p2shaddr,dstr(ap->zeroconf_credits));
@ -209,7 +209,7 @@ void LP_zeroconf_deposits(struct iguana_info *coin)
cJSON *array,*item,*txjson,*vouts,*v,*txobj; int32_t i,n,numvouts,height,vout,weeki; bits256 txid; char destaddr[64],p2shaddr[64]; int64_t satoshis,amount64;
if ( (array= LP_listreceivedbyaddress("KMD",BOTS_BONDADDRESS)) != 0 )
{
printf("ZEROCONF.(%s)\n",jprint(array,0));
//printf("ZEROCONF.(%s)\n",jprint(array,0));
if ( (n= cJSON_GetArraySize(array)) > 0 )
{
for (i=0; i<n; i++)
@ -228,7 +228,7 @@ void LP_zeroconf_deposits(struct iguana_info *coin)
weeki = (amount64 % 10000);
v = jitem(vouts,0);
satoshis = LP_value_extract(v,0);
printf("%s funded %.8f weeki.%d\n",destaddr,dstr(satoshis),weeki);
//printf("%s funded %.8f weeki.%d\n",destaddr,dstr(satoshis),weeki);
if ( LP_destaddr(p2shaddr,v) == 0 )
{
if ( (txobj= LP_gettxout(coin->symbol,p2shaddr,txid,0)) != 0 )

3
iguana/exchanges/stats.c

@ -624,10 +624,12 @@ void LP_rpc_processreq(void *_ptr)
printf("EAGAIN for len %d, remains.%d\n",len,remains);
usleep(10000);
}
printf("errno.%d len.%d remains.%d\n",errno,len,remains);
break;
}
else
{
printf("received len.%d\n",len);
if ( len > 0 )
{
buf[len] = 0;
@ -787,6 +789,7 @@ void stats_rpcloop(void *args)
memcpy(&ipbits,&cli_addr.sin_addr.s_addr,sizeof(ipbits));
if ( port == RPC_port && ipbits != localhostbits )
{
printf("port.%u RPC_port.%u ipbits %x != %x\n",port,RPC_port,ipbits,localhostbits);
closesocket(sock);
continue;
}

Loading…
Cancel
Save