Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
5cef1d5b2f
  1. 6
      iguana/SuperNET.c
  2. 4
      iguana/iguana_msg.c

6
iguana/SuperNET.c

@ -444,9 +444,9 @@ void iguana_setkeys(struct supernet_info *myinfo,struct iguana_peer *addr,bits25
*nextpubp = myinfo->myaddr.pubkey;
*nextdestpubp = addr->pubkey;
*myprivp = *nextprivp, *mypubp = *nextpubp, *destpubp = *nextdestpubp;
if ( addr->validpub < 3 )
//if ( addr->validpub < 3 )
*destpubp = GENESIS_PUBKEY;
if ( addr->othervalid < 3 )
//if ( addr->othervalid < 3 )
*myprivp = GENESIS_PRIVKEY, *mypubp = GENESIS_PUBKEY;
//char str[65]; printf("(priv.%llx pub.%llx) -> destpub.%s\n",(long long)myprivp->txid,(long long)mypubp->txid,bits256_str(str,*destpubp));
}
@ -490,7 +490,7 @@ int32_t iguana_send_supernet(struct iguana_peer *addr,char *jsonstr,int32_t dela
{
if ( 0 && jstr(json,"method") != 0 && strcmp("getpeers",jstr(json,"method")) != 0 )
printf("SUPERSEND -> (%s) (%s) delaymillis.%d datalen.%d checkc.%x\n",jprint(SuperNET_bits2json(&serialized[sizeof(struct iguana_msghdr)],datalen),1),addr->ipaddr,delaymillis,datalen,checkc);
if ( 0 && memcmp(destpub.bytes,GENESIS_PUBKEY.bytes,sizeof(destpub)) == 0 )
if ( 1 && memcmp(destpub.bytes,GENESIS_PUBKEY.bytes,sizeof(destpub)) == 0 )
qlen = iguana_queue_send(addr,delaymillis,serialized,"SuperNET",datalen,0,0);
else
{

4
iguana/iguana_msg.c

@ -573,9 +573,9 @@ int32_t iguana_msgparser(struct iguana_info *coin,struct iguana_peer *addr,struc
//iguana_peerblockrequest(coin,addr->blockspace,IGUANA_MAXPACKETSIZE,addr,iguana_blockhash(coin,100),0);
addr->lastcontact = (uint32_t)time(NULL);
strcpy(addr->lastcommand,H->command);
//printf("iguana_msgparser from (%s) parse.(%s) len.%d\n",addr->ipaddr,H->command,recvlen);
if ( strncmp(H->command,"SuperNET",strlen("SuperNET")) == 0 )
{
printf("iguana_msgparser from (%s) parse.(%s) len.%d\n",addr->ipaddr,H->command,recvlen);
addr->supernet = 1;
addr->msgcounts.verack++;
len = recvlen;
@ -592,7 +592,7 @@ int32_t iguana_msgparser(struct iguana_info *coin,struct iguana_peer *addr,struc
iguana_send_supernet(addr,retstr,delay);
free(retstr);
}
//printf("GOT.(%s) [%s] len.%d from %s -> (%s)\n",H->command,data,recvlen,addr->ipaddr,retstr==0?"null":retstr);
printf("GOT.(%s) [%s] len.%d from %s -> (%s)\n",H->command,data,recvlen,addr->ipaddr,retstr==0?"null":retstr);
return(0);
}
else if ( strcmp(H->command,"InstantDEX") == 0 )

Loading…
Cancel
Save