Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
f65aab6385
  1. 2
      iguana/iguana_instantdex.c
  2. 19
      iguana/iguana_json.c

2
iguana/iguana_instantdex.c

@ -374,7 +374,7 @@ char *instantdex_sendcmd(struct supernet_info *myinfo,struct instantdex_offer *o
iguana_queue_send(coin,addr,0,serialized,"InstantDEX",msg->sig.allocsize,0,1);
if ( --hops <= 0 )
break;
} else printf("skip.%d addr.%p (%s)\n",j,addr,addr!=0?addr->ipaddr:"");
} else printf("skip.%d addr.%p (%s) max.%d hops.%d\n",j,addr,addr!=0?addr->ipaddr:"",max,hops);
}
} else printf("cant find coin.%p or no ranked.%d\n",coin,max);
free(msg); //free(hexstr),

19
iguana/iguana_json.c

@ -657,7 +657,7 @@ STRING_ARG(iguana,pausecoin,activecoin)
TWO_STRINGS(iguana,addnode,activecoin,ipaddr)
{
struct iguana_peer *addr;
struct iguana_peer *addr; int32_t i,n;
if ( coin == 0 )
coin = iguana_coinfind(activecoin);
printf("coin.%p.[%s] addnode.%s -> %s\n",coin,coin!=0?coin->symbol:"",activecoin,ipaddr);
@ -668,7 +668,24 @@ TWO_STRINGS(iguana,addnode,activecoin,ipaddr)
{
addr->supernet = 1;
if ( addr->usock >= 0 )
{
if ( (n= coin->peers.numranked) != 0 )
{
for (i=0; i<n; i++)
{
if ( addr == coin->peers.ranked[i] )
break;
}
if ( i == n )
{
if ( i == IGUANA_MAXPEERS )
i--;
else coin->peers.numranked = n+1;
coin->peers.ranked[i] = addr;
}
}
return(clonestr("{\"result\":\"peer was already connected\"}"));
}
if ( addr->pending == 0 )
{
addr->pending = (uint32_t)time(NULL);

Loading…
Cancel
Save