Browse Source

Test

etomic
jl777 8 years ago
parent
commit
28bb4b08d5
  1. 2
      iguana/exchanges/LP_include.h
  2. 2
      iguana/exchanges/LP_nativeDEX.c
  3. 3
      iguana/exchanges/LP_peers.c
  4. 2
      iguana/exchanges/LP_rpc.c

2
iguana/exchanges/LP_include.h

@ -22,6 +22,8 @@
#define LP_INCLUDE_H
#define LP_HTTP_TIMEOUT 1
#define LP_MAXPEER_ERRORS 3
#define LP_DEXFEE(destsatoshis) ((destsatoshis) / INSTANTDEX_INSURANCEDIV)
#define LP_DEPOSITSATOSHIS(satoshis) ((satoshis) + (satoshis >> 3))

2
iguana/exchanges/LP_nativeDEX.c

@ -202,7 +202,7 @@ void LP_peer_utxosquery(struct LP_peerinfo *mypeer,uint16_t myport,int32_t pubso
peer->lastutxos = now;
LP_utxosquery(mypeer,pubsock,peer->ipaddr,peer->port,"",lastn,mypeer != 0 ? mypeer->ipaddr : "127.0.0.1",myport,profitmargin);
}
} else printf("LP_peer_utxosquery skip.(%s) %u\n",peer->ipaddr,peer->lastutxos);
} //else printf("LP_peer_utxosquery skip.(%s) %u\n",peer->ipaddr,peer->lastutxos);
}
void LP_mainloop(char *myipaddr,struct LP_peerinfo *mypeer,uint16_t mypubport,int32_t pubsock,char *pushaddr,int32_t pullsock,uint16_t myport,char *passphrase,double profitmargin,cJSON *coins,char *seednode)

3
iguana/exchanges/LP_peers.c

@ -42,7 +42,8 @@ char *LP_peers()
struct LP_peerinfo *peer,*tmp; cJSON *peersjson = cJSON_CreateArray();
HASH_ITER(hh,LP_peerinfos,peer,tmp)
{
jaddi(peersjson,LP_peerjson(peer));
if ( peer->errors < LP_MAXPEER_ERRORS )
jaddi(peersjson,LP_peerjson(peer));
}
return(jprint(peersjson,1));
}

2
iguana/exchanges/LP_rpc.c

@ -22,7 +22,7 @@ char *LP_issue_curl(char *debugstr,char *destip,uint16_t port,char *url)
{
char *retstr = 0; struct LP_peerinfo *peer = 0;
peer = LP_peerfind((uint32_t)calc_ipbits(destip),port);
if ( peer == 0 || peer->errors < 3 )
if ( peer == 0 || peer->errors < LP_MAXPEER_ERRORS )
{
if ( (retstr= issue_curlt(url,LP_HTTP_TIMEOUT)) == 0 )
{

Loading…
Cancel
Save