Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
67fd0bed64
  1. 6
      iguana/iguana_json.c
  2. 2
      iguana/iguana_peers.c

6
iguana/iguana_json.c

@ -288,12 +288,16 @@ char *iguana_agentjson(char *name,struct iguana_info *coin,char *method,cJSON *j
{
retjson = cJSON_CreateObject();
jaddstr(retjson,"agent","SuperNET");
jaddstr(retjson,"method","peers");
jaddstr(retjson,"method","mypeers");
jaddstr(retjson,"result","peers found");
jadd(retjson,"peers",array);
return(jprint(retjson,1));
} else return(clonestr("{\"error\":\"no peers found\"}"));
}
else if ( strcmp(method,"mypeers") == 0 )
{
printf("mypeers from %s\n",remoteaddr!=0?remoteaddr:"local");
}
}
else // local api
{

2
iguana/iguana_peers.c

@ -919,9 +919,7 @@ void iguana_dedicatedloop(struct iguana_info *coin,struct iguana_peer *addr)
iguana_send_supernet(coin,addr,"{\"agent\":\"SuperNET\",\"method\":\"getpeers\"}",0);
sleep(1);
iguana_send_version(coin,addr,coin->myservices);
printf("after send version\n");
iguana_queue_send(coin,addr,0,serialized,"getaddr",0,0,0);
printf("after send getaddr\n");
run = 0;
while ( addr->usock >= 0 && addr->dead == 0 && coin->peers.shuttingdown == 0 )
{

Loading…
Cancel
Save