diff --git a/iguana/SuperNET.c b/iguana/SuperNET.c index 1effabc56..db6dd38d9 100644 --- a/iguana/SuperNET.c +++ b/iguana/SuperNET.c @@ -317,7 +317,7 @@ int32_t iguana_send_supernet(struct iguana_info *coin,struct iguana_peer *addr,c serialized = malloc(sizeof(struct iguana_msghdr) + IGUANA_MAXPACKETSIZE); if ( addr->validpub > 3 && addr->othervalid > 3 ) { - memset(privkey.bytes,0,sizeof(privkey));// = myinfo->privkey; + privkey = myinfo->privkey; destpub = addr->pubkey; } else privkey = GENESIS_PRIVKEY, destpub = GENESIS_PUBKEY; if ( (datalen= SuperNET_json2bits(myinfo->ipaddr,myinfo->privkey,myinfo->myaddr.pubkey,&serialized[sizeof(struct iguana_msghdr)],IGUANA_MAXPACKETSIZE,addr->ipaddr,json,addr->pubkey,addr->validpub)) > 0 ) @@ -542,10 +542,12 @@ char *SuperNET_p2p(struct iguana_info *coin,struct iguana_peer *addr,int32_t *de if ( addr->validpub > 3 && addr->othervalid > 3 ) { privkey = myinfo->privkey; - memset(senderpub.bytes,0,sizeof(senderpub));//senderpub = addr->pubkey; + senderpub = addr->pubkey; } else privkey = GENESIS_PRIVKEY, senderpub = GENESIS_PUBKEY; if ( (msgbits= SuperNET_deciphercalc(&ptr,&msglen,privkey,senderpub,data,datalen,space,sizeof(space))) == 0 ) { + memset(addr->pubkey.bytes,0,sizeof(addr->pubkey)); + addr->validpub = addr->othervalid = 0; printf("couldnt decrypt\n"); return(clonestr("{\"error\":\"couldnt decrypt p2p packet\"}")); } diff --git a/iguana/iguana_peers.c b/iguana/iguana_peers.c index c8618be08..9bb56058b 100755 --- a/iguana/iguana_peers.c +++ b/iguana/iguana_peers.c @@ -921,7 +921,7 @@ void iguana_dedicatedloop(struct iguana_info *coin,struct iguana_peer *addr) #endif addr->addrind = (int32_t)(((long)addr - (long)&coin->peers.active[0]) / sizeof(*addr)); ipbits = (uint32_t)addr->ipbits; - addr->pubkey = GENESIS_PUBKEY; + //addr->pubkey = GENESIS_PUBKEY; vcalc_sha256(0,addr->iphash.bytes,(uint8_t *)&ipbits,sizeof(ipbits)); char str[65]; printf("start dedicatedloop.%s addrind.%d %s\n",addr->ipaddr,addr->addrind,bits256_str(str,addr->iphash)); addr->maxfilehash2 = IGUANA_MAXFILEITEMS;