|
@ -315,7 +315,7 @@ int32_t iguana_send_supernet(struct iguana_info *coin,struct iguana_peer *addr,c |
|
|
if ( (json= cJSON_Parse(jsonstr)) != 0 ) |
|
|
if ( (json= cJSON_Parse(jsonstr)) != 0 ) |
|
|
{ |
|
|
{ |
|
|
serialized = malloc(sizeof(struct iguana_msghdr) + IGUANA_MAXPACKETSIZE); |
|
|
serialized = malloc(sizeof(struct iguana_msghdr) + IGUANA_MAXPACKETSIZE); |
|
|
privkey = GENESIS_PRIVKEY;//myinfo->privkey;
|
|
|
privkey = myinfo->privkey; |
|
|
if ( addr->validpub > 1 && addr->othervalid > 3 ) |
|
|
if ( addr->validpub > 1 && addr->othervalid > 3 ) |
|
|
destpub = addr->pubkey; |
|
|
destpub = addr->pubkey; |
|
|
else privkey = GENESIS_PRIVKEY, destpub = GENESIS_PUBKEY; |
|
|
else privkey = GENESIS_PRIVKEY, destpub = GENESIS_PUBKEY; |
|
@ -539,11 +539,10 @@ char *SuperNET_p2p(struct iguana_info *coin,struct iguana_peer *addr,int32_t *de |
|
|
//int32_t i; for (i=0; i<datalen; i++)
|
|
|
//int32_t i; for (i=0; i<datalen; i++)
|
|
|
// printf("%02x ",data[i]);
|
|
|
// printf("%02x ",data[i]);
|
|
|
//printf("DECRYPT %d\n",datalen);
|
|
|
//printf("DECRYPT %d\n",datalen);
|
|
|
if ( addr->validpub > 1 && addr->othervalid > 3 ) |
|
|
if ( addr->validpub > 3 && addr->othervalid > 3 ) |
|
|
{ |
|
|
{ |
|
|
privkey = GENESIS_PRIVKEY;//myinfo->privkey;
|
|
|
privkey = myinfo->privkey; |
|
|
senderpub = addr->pubkey; |
|
|
memcpy(senderpub.bytes,data,sizeof(senderpub));// = addr->pubkey;
|
|
|
//memset(senderpub.bytes,0,sizeof(senderpub));
|
|
|
|
|
|
printf("decrypt with priv.%llx pub.%llx\n",(long long)privkey.txid,(long long)senderpub.txid); |
|
|
printf("decrypt with priv.%llx pub.%llx\n",(long long)privkey.txid,(long long)senderpub.txid); |
|
|
} else privkey = GENESIS_PRIVKEY, senderpub = GENESIS_PUBKEY; |
|
|
} else privkey = GENESIS_PRIVKEY, senderpub = GENESIS_PUBKEY; |
|
|
if ( (msgbits= SuperNET_deciphercalc(&ptr,&msglen,privkey,senderpub,data,datalen,space,sizeof(space))) == 0 ) |
|
|
if ( (msgbits= SuperNET_deciphercalc(&ptr,&msglen,privkey,senderpub,data,datalen,space,sizeof(space))) == 0 ) |
|
|