Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
5b1d60914d
  1. 6
      iguana/SuperNET.c
  2. 2
      iguana/iguana_peers.c

6
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\"}"));
}

2
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;

Loading…
Cancel
Save