Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
e08517d0e0
  1. 7
      iguana/SuperNET.c
  2. 4
      iguana/SuperNET_hexmsg.c

7
iguana/SuperNET.c

@ -604,8 +604,8 @@ char *SuperNET_JSON(struct supernet_info *myinfo,cJSON *json,char *remoteaddr)
char *SuperNET_p2p(struct iguana_info *coin,struct iguana_peer *addr,int32_t *delaymillisp,char *ipaddr,uint8_t *data,int32_t datalen,int32_t compressed)
{
struct supernet_info *myinfo;char *myipaddr,*method,*retstr,*checkstr; void *ptr=0;
bits256 senderpub,privkey,pubkey,nextprivkey,nextpubkey,nextdestpub; uint16_t checkc,othercheckc;
struct supernet_info *myinfo; char *hexmsg,*myipaddr,*method,*retstr,*checkstr; void *ptr=0;
bits256 senderpub,privkey,pubkey,nextprivkey,nextpubkey,nextdestpub,destpub; uint16_t checkc,othercheckc;
cJSON *json,*retjson; int32_t offset,maxdelay,msglen = datalen; uint8_t space[8192],*msgbits = 0;
myinfo = SuperNET_MYINFO(0);
retstr = 0;
@ -666,6 +666,9 @@ char *SuperNET_p2p(struct iguana_info *coin,struct iguana_peer *addr,int32_t *de
return(0);
}
retstr = SuperNET_JSON(myinfo,json,ipaddr);
destpub = jbits256(json,"destpub");
if ( 0 && (hexmsg= jstr(json,"hexmsg")) != 0 && SuperNET_hexmsgfind(myinfo,destpub,hexmsg,0) < 0 )
SuperNET_hexmsgadd(myinfo,destpub,hexmsg,tai_now());
//printf("p2pret.(%s)\n",retstr);
*delaymillisp = SuperNET_delaymillis(myinfo,maxdelay);
senderpub = jbits256(json,"mypub");

4
iguana/SuperNET_hexmsg.c

@ -39,7 +39,7 @@ int32_t SuperNET_hexmsgfind(struct supernet_info *myinfo,bits256 dest,char *hexm
else if ( Packetcache[i] == packethash.txid )
{
printf("SuperNET_DHTsend reject duplicate packet.%llx (%s)\n",(long long)packethash.txid,hexmsg);
return(-1);
return(i);
}
}
if ( i == sizeof(Packetcache)/sizeof(*Packetcache) )
@ -52,7 +52,7 @@ int32_t SuperNET_hexmsgfind(struct supernet_info *myinfo,bits256 dest,char *hexm
lastpurge = 0;
}
}
return(i);
return(-1);
}
void SuperNET_hexmsgadd(struct supernet_info *myinfo,bits256 destpub,char *hexmsg,struct tai now)

Loading…
Cancel
Save