Browse Source

Test

etomic
jl777 7 years ago
parent
commit
fcee4d1518
  1. 2
      iguana/exchanges/LP_include.h
  2. 4
      iguana/exchanges/LP_instantdex.c
  3. 3
      iguana/exchanges/LP_stats.c

2
iguana/exchanges/LP_include.h

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

4
iguana/exchanges/LP_instantdex.c

@ -468,6 +468,8 @@ cJSON *LP_swapstats_item(struct LP_swapstats *sp,int32_t iambob)
jaddnum(item,"bob_dPoWheight",bob->notarized); jaddnum(item,"bob_dPoWheight",bob->notarized);
if ( sp->bobneeds_dPoW == 1 ) if ( sp->bobneeds_dPoW == 1 )
flag = 1; flag = 1;
if ( bob->notarized == 0 )
LP_dPoW_request(bob);
} }
if ( sp->aliceneeds_dPoW != 0 && (alice= LP_coinfind(sp->Q.destcoin)) != 0 ) if ( sp->aliceneeds_dPoW != 0 && (alice= LP_coinfind(sp->Q.destcoin)) != 0 )
{ {
@ -475,6 +477,8 @@ cJSON *LP_swapstats_item(struct LP_swapstats *sp,int32_t iambob)
jaddnum(item,"alice_dPoWheight",alice->notarized); jaddnum(item,"alice_dPoWheight",alice->notarized);
if ( sp->aliceneeds_dPoW == 1 ) if ( sp->aliceneeds_dPoW == 1 )
flag = 1; flag = 1;
if ( alice->notarized == 0 )
LP_dPoW_request(alice);
} }
if ( flag != 0 ) if ( flag != 0 )
{ {

3
iguana/exchanges/LP_stats.c

@ -42,7 +42,7 @@ void LP_dPoW_request(struct iguana_info *coin)
void LP_dPoW_broadcast(struct iguana_info *coin) void LP_dPoW_broadcast(struct iguana_info *coin)
{ {
bits256 zero; cJSON *reqjson; bits256 zero; cJSON *reqjson;
if ( coin->isassetchain != 0 || strcmp(coin->symbol,"KMD") == 0 ) if ( time(NULL) > coin->dPoWtime+60 && (coin->isassetchain != 0 || strcmp(coin->symbol,"KMD") == 0) )
{ {
reqjson = cJSON_CreateObject(); reqjson = cJSON_CreateObject();
jaddstr(reqjson,"method","dPoW"); jaddstr(reqjson,"method","dPoW");
@ -53,6 +53,7 @@ void LP_dPoW_broadcast(struct iguana_info *coin)
memset(zero.bytes,0,sizeof(zero)); memset(zero.bytes,0,sizeof(zero));
printf("broadcast %s\n",jprint(reqjson,0)); printf("broadcast %s\n",jprint(reqjson,0));
LP_reserved_msg(0,coin->symbol,coin->symbol,zero,jprint(reqjson,1)); LP_reserved_msg(0,coin->symbol,coin->symbol,zero,jprint(reqjson,1));
coin->dPoWtime = (uint32_t)time(NULL);
} }
} }

Loading…
Cancel
Save