diff --git a/iguana/SuperNET.c b/iguana/SuperNET.c index cfd00b43a..c9062add1 100644 --- a/iguana/SuperNET.c +++ b/iguana/SuperNET.c @@ -189,7 +189,7 @@ cJSON *SuperNET_bits2json(struct supernet_info *myinfo,bits256 senderpub,bits256 iguana_rwnum(0,serialized,sizeof(checkcrc),&checkcrc); //int32_t i; for (i=0; ivalidpub++ > 3 ) - addr->sharedseed = SuperNET_sharedseed(myinfo,senderpub); - } else addr->validpub = 0, memset(addr->sharedseed.bytes,0,sizeof(addr->sharedseed)); + addr->validpub++; + else if ( addr->validpub > 0 ) + addr->validpub >>= 1; + else addr->validpub--; printf("validpub.%d: %x vs %x shared.%llx\n",addr->validpub,checkc,othercheckc,(long long)addr->sharedseed.txid); - } else addr->validpub = 0, memset(addr->sharedseed.bytes,0,sizeof(addr->sharedseed)); + } + if ( addr->validpub > 3 ) + addr->sharedseed = SuperNET_sharedseed(myinfo,senderpub); + else if ( addr->validpub < -2 ) + memset(addr->sharedseed.bytes,0,sizeof(addr->sharedseed)); maxdelay = juint(json,"maxdelay"); printf("GOT >>>>>>>> SUPERNET P2P.(%s) from.%s\n",jprint(json,0),coin->symbol); if ( (myipaddr= jstr(json,"yourip")) != 0 )