Browse Source

Test

etomic
jl777 8 years ago
parent
commit
b1e71e6af8
  1. 4
      iguana/exchanges/LP_nativeDEX.c
  2. 2
      iguana/exchanges/LP_utxos.c

4
iguana/exchanges/LP_nativeDEX.c

@ -194,12 +194,14 @@ void LP_peer_utxosquery(struct LP_peerinfo *mypeer,uint16_t myport,int32_t pubso
int32_t lastn; int32_t lastn;
if ( now > peer->lastutxos+interval ) if ( now > peer->lastutxos+interval )
{ {
peer->lastutxos = now;
//lastn = peer->numutxos - mypeer->numutxos + LP_PROPAGATION_SLACK; //lastn = peer->numutxos - mypeer->numutxos + LP_PROPAGATION_SLACK;
//if ( lastn < LP_PROPAGATION_SLACK * 2 ) //if ( lastn < LP_PROPAGATION_SLACK * 2 )
lastn = LP_PROPAGATION_SLACK * 2; lastn = LP_PROPAGATION_SLACK * 2;
if ( mypeer == 0 || strcmp(peer->ipaddr,mypeer->ipaddr) != 0 ) if ( mypeer == 0 || strcmp(peer->ipaddr,mypeer->ipaddr) != 0 )
{
peer->lastutxos = now;
LP_utxosquery(mypeer,pubsock,peer->ipaddr,peer->port,"",lastn,mypeer != 0 ? mypeer->ipaddr : "127.0.0.1",myport,profitmargin); LP_utxosquery(mypeer,pubsock,peer->ipaddr,peer->port,"",lastn,mypeer != 0 ? mypeer->ipaddr : "127.0.0.1",myport,profitmargin);
}
} }
} }

2
iguana/exchanges/LP_utxos.c

@ -476,10 +476,12 @@ void LP_utxosquery(struct LP_peerinfo *mypeer,int32_t mypubsock,char *destipaddr
peer = LP_peerfind((uint32_t)calc_ipbits(destipaddr),destport); peer = LP_peerfind((uint32_t)calc_ipbits(destipaddr),destport);
if ( coin == 0 ) if ( coin == 0 )
coin = ""; coin = "";
printf("utxo query\n");
if ( (retstr= issue_LP_getutxos(destipaddr,destport,coin,lastn,myipaddr,myport,myprofit,mypeer != 0 ? mypeer->numpeers : 0,mypeer != 0 ? mypeer->numutxos : 0)) != 0 ) if ( (retstr= issue_LP_getutxos(destipaddr,destport,coin,lastn,myipaddr,myport,myprofit,mypeer != 0 ? mypeer->numpeers : 0,mypeer != 0 ? mypeer->numutxos : 0)) != 0 )
{ {
now = (uint32_t)time(NULL); now = (uint32_t)time(NULL);
LP_utxosparse(mypubsock,destipaddr,destport,retstr,now); LP_utxosparse(mypubsock,destipaddr,destport,retstr,now);
printf("got.(%s)\n",retstr);
free(retstr); free(retstr);
/*i = 0; /*i = 0;
if ( lastn >= mypeer->numutxos ) if ( lastn >= mypeer->numutxos )

Loading…
Cancel
Save