Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
483f9899ad
  1. 2
      iguana/iguana_msg.c
  2. 1
      iguana/iguana_peers.c

2
iguana/iguana_msg.c

@ -127,7 +127,7 @@ int32_t iguana_rwblockhash(int32_t rwflag,uint8_t *serialized,uint32_t *nVersion
int32_t iguana_send_supernet(struct iguana_info *coin,struct iguana_peer *addr,char *jsonstr) int32_t iguana_send_supernet(struct iguana_info *coin,struct iguana_peer *addr,char *jsonstr)
{ {
int32_t len; uint8_t serialized[8192]; int32_t len; uint8_t serialized[8192];
if ( (len= (int32_t)strlen(jsonstr)) < sizeof(serialized)-sizeof(struct iguana_msghdr) ) if ( addr->supernet != 0 && (len= (int32_t)strlen(jsonstr)) < sizeof(serialized)-sizeof(struct iguana_msghdr) )
{ {
memcpy(&serialized[sizeof(struct iguana_msghdr)],jsonstr,len+1); memcpy(&serialized[sizeof(struct iguana_msghdr)],jsonstr,len+1);
printf("SEND.(%s) -> (%s)\n",jsonstr,addr->ipaddr); printf("SEND.(%s) -> (%s)\n",jsonstr,addr->ipaddr);

1
iguana/iguana_peers.c

@ -891,6 +891,7 @@ void iguana_dedicatedloop(struct iguana_info *coin,struct iguana_peer *addr)
//printf("send version myservices.%llu\n",(long long)coin->myservices); //printf("send version myservices.%llu\n",(long long)coin->myservices);
iguana_send_version(coin,addr,coin->myservices); iguana_send_version(coin,addr,coin->myservices);
iguana_queue_send(coin,addr,serialized,"getaddr",0,0,0); iguana_queue_send(coin,addr,serialized,"getaddr",0,0,0);
if ( addr->supernet != 0 )
iguana_send_supernet(coin,addr,"{\"agent\":\"SuperNET\",\"method\":\"getpeers\"}"); iguana_send_supernet(coin,addr,"{\"agent\":\"SuperNET\",\"method\":\"getpeers\"}");
//printf("after send version\n"); //printf("after send version\n");
run = 0; run = 0;

Loading…
Cancel
Save