From 6aeac1a52db7ffcebf08591831a35c67560f6d81 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 24 Jan 2016 09:09:16 -0300 Subject: [PATCH] test --- iguana/SuperNET_category.c | 2 +- iguana/main.c | 4 ++-- iguana/pangea_api.c | 7 ++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/iguana/SuperNET_category.c b/iguana/SuperNET_category.c index f05ec95e6..a9df93e13 100644 --- a/iguana/SuperNET_category.c +++ b/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); diff --git a/iguana/main.c b/iguana/main.c index 90f7ca4a5..a429c235c 100644 --- a/iguana/main.c +++ b/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); diff --git a/iguana/pangea_api.c b/iguana/pangea_api.c index 8a158aa50..c58777673 100755 --- a/iguana/pangea_api.c +++ b/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++; }