Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
6aeac1a52d
  1. 2
      iguana/SuperNET_category.c
  2. 4
      iguana/main.c
  3. 7
      iguana/pangea_api.c

2
iguana/SuperNET_category.c

@ -93,7 +93,7 @@ void category_posthexmsg(struct supernet_info *myinfo,bits256 categoryhash,bits2
m->t = now, m->len = len;
decode_hex(m->msg,m->len,hexmsg);
queue_enqueue("categoryQ",Q,&m->DL,0);
char str[65]; printf("POST HEXMSG.(%s) -> %s.%llx len.%d\n",hexmsg,bits256_str(str,categoryhash),(long long)subhash.txid,m->len);
//char str[65]; printf("POST HEXMSG.(%s) -> %s.%llx len.%d\n",hexmsg,bits256_str(str,categoryhash),(long long)subhash.txid,m->len);
return;
}
// char str[65]; printf("no subscription for category.(%s) %llx\n",bits256_str(str,categoryhash),(long long)subhash.txid);

4
iguana/main.c

@ -467,12 +467,12 @@ void iguana_main(void *arg)
iguana_launch(iguana_coinadd("BTCD"),"rpcloop",iguana_rpcloop,SuperNET_MYINFO(0),IGUANA_PERMTHREAD);
if ( coinargs != 0 )
iguana_launch(iguana_coinadd("BTCD"),"iguana_coins",iguana_coins,coinargs,IGUANA_PERMTHREAD);
else if ( 0 )
else if ( 1 )
{
#ifdef __APPLE__
sleep(1);
char *str;
if ( (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"wallet\":\"password\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":128,\"maxpeers\":12,\"activecoin\":\"BTCD\",\"active\":1}"),0)) != 0 )
if ( (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"wallet\":\"password\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":128,\"maxpeers\":1,\"activecoin\":\"BTCD\",\"active\":0}"),0)) != 0 )
{
printf("got.(%s)\n",str);
free(str);

7
iguana/pangea_api.c

@ -116,6 +116,7 @@ struct pangea_msghdr *pangea_msgcreate(struct supernet_info *myinfo,bits256 tabl
acct777_sign(&pm->sig,myinfo->privkey,otherpubkey,timestamp,serialized,datalen);
if ( pangea_validate(pm,acct777_msgprivkey(serialized,datalen),pm->sig.pubkey) == 0 )
{
printf(">>>>>>>>>>>>>>>> validated [%ld] len.%d\n",(long)serialized-(long)pm,datalen);
memset(buf,0,sizeof(buf));
acct777_rwsig(1,buf,&pm->sig);
memcpy(&pm->sig,buf,sizeof(buf));
@ -569,7 +570,11 @@ ZERO_ARGS(pangea,lobby)
pm->tablehash = tablehash;
if ( pangea_validate(pm,acct777_msgprivkey(pm->serialized,pm->sig.allocsize-(int32_t)((long)pm->serialized - (long)pm)),pm->sig.pubkey) == 0 )
printf("VALIDATED! ");
printf("len.%d time.%u RESULT.(%s) (%s)\n",pm->sig.allocsize,pm->sig.timestamp,result,pm->serialized);
else printf("SIG ERROR ");
printf("len.%d time.%u RESULT.(%s) (%s) [%ld].%d\n",pm->sig.allocsize,pm->sig.timestamp,result,pm->serialized,(long)pm->serialized - (long)pm,pm->sig.allocsize-(int32_t)((long)pm->serialized - (long)pm));
if ( pangea_validate(pm,acct777_msgprivkey(pm->serialized,pm->sig.allocsize-(int32_t)((long)pm->serialized - (long)pm)),pm->sig.pubkey) == 0 )
printf("VALIDATED!\n");
else printf("SIG ERROR\n");
}
flag++;
}

Loading…
Cancel
Save