Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
827dc933c1
  1. 4
      iguana/SuperNET.c
  2. 1
      iguana/iguana777.h
  3. 2
      iguana/iguana_accept.c
  4. 2
      iguana/main.c

4
iguana/SuperNET.c

@ -28,10 +28,10 @@ int32_t SuperNET_delaymillis(struct supernet_info *myinfo,int32_t maxdelay)
void SuperNET_remotepeer(struct supernet_info *myinfo,struct iguana_info *coin,char *symbol,char *ipaddr,int32_t supernetflag) void SuperNET_remotepeer(struct supernet_info *myinfo,struct iguana_info *coin,char *symbol,char *ipaddr,int32_t supernetflag)
{ {
uint64_t ipbits; struct iguana_peer *addr; uint64_t ipbits; struct iguana_peer *addr;
ipbits = calc_ipbits(ipaddr);
printf("got %s remotepeer.(%s) supernet.%d\n",symbol,ipaddr,supernetflag); printf("got %s remotepeer.(%s) supernet.%d\n",symbol,ipaddr,supernetflag);
if ( supernetflag != 0 ) if ( supernetflag != 0 && (uint32_t)myinfo->myaddr.selfipbits != (uint32_t)ipbits )
{ {
ipbits = calc_ipbits(ipaddr);
if ( (addr= iguana_peerslot(coin,ipbits)) != 0 ) if ( (addr= iguana_peerslot(coin,ipbits)) != 0 )
{ {
printf("launch startconnection to supernet peer.(%s)\n",ipaddr); printf("launch startconnection to supernet peer.(%s)\n",ipaddr);

1
iguana/iguana777.h

@ -693,6 +693,7 @@ void ramcoder_test(void *data,int64_t len);
void iguana_exit(); void iguana_exit();
int32_t iguana_pendingaccept(struct iguana_info *coin); int32_t iguana_pendingaccept(struct iguana_info *coin);
char *iguana_blockingjsonstr(struct supernet_info *myinfo,char *jsonstr,uint64_t tag,int32_t maxmillis,char *remoteaddr); char *iguana_blockingjsonstr(struct supernet_info *myinfo,char *jsonstr,uint64_t tag,int32_t maxmillis,char *remoteaddr);
void iguana_iAkill(struct iguana_info *coin,struct iguana_peer *addr,int32_t markflag);
extern queue_t bundlesQ; extern queue_t bundlesQ;

2
iguana/iguana_accept.c

@ -91,7 +91,7 @@ void iguana_acceptloop(void *args)
if ( coin->peers.active[i].ipbits == (uint32_t)ipbits && coin->peers.active[i].usock >= 0 ) if ( coin->peers.active[i].ipbits == (uint32_t)ipbits && coin->peers.active[i].usock >= 0 )
{ {
printf("found existing peer.(%s) in slot[%d]\n",ipaddr,i); printf("found existing peer.(%s) in slot[%d]\n",ipaddr,i);
coin->peers.active[i].dead = (uint32_t)time(NULL); iguana_iAkill(coin,addr,0);
sleep(1); sleep(1);
} }
} }

2
iguana/main.c

@ -321,7 +321,7 @@ void iguana_main(void *arg)
#ifdef __APPLE__ #ifdef __APPLE__
sleep(1); sleep(1);
char *str; char *str;
if ( (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":0,\"maxpeers\":2,\"activecoin\":\"BTCD\",\"active\":1}"),0)) != 0 ) if ( (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":128,\"maxpeers\":2,\"activecoin\":\"BTCD\",\"active\":1}"),0)) != 0 )
{ {
printf("got.(%s)\n",str); printf("got.(%s)\n",str);
free(str); free(str);

Loading…
Cancel
Save