From 6541afc04ebd914f068c91f3b73476fac9379c7a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 19 Jun 2016 11:46:12 -0300 Subject: [PATCH] test --- basilisk/basilisk.c | 14 +++++++------- gecko/gecko.c | 1 + gecko/gecko_blocks.c | 6 ++++-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/basilisk/basilisk.c b/basilisk/basilisk.c index a07f65736..1768b0cef 100755 --- a/basilisk/basilisk.c +++ b/basilisk/basilisk.c @@ -269,9 +269,9 @@ void basilisk_p2p(void *_myinfo,void *_addr,char *senderip,uint8_t *data,int32_t ipbits = (uint32_t)calc_ipbits(senderip); else ipbits = 0; len += iguana_rwnum(0,data,sizeof(basilisktag),&basilisktag); - int32_t i; for (i=0; ireceived.%d basilisk_p2p.(%s) from %s tag.%d\n",datalen,type,senderip!=0?senderip:"?",basilisktag); + //int32_t i; for (i=0; ireceived.%d basilisk_p2p.(%s) from %s tag.%d\n",datalen,type,senderip!=0?senderip:"?",basilisktag); basilisk_msgprocess(myinfo,_addr,ipbits,type,basilisktag,&data[len],datalen - len); if ( ptr != 0 ) free(ptr); @@ -788,9 +788,9 @@ void basilisks_loop(void *arg) iter++; if ( (ptr= queue_dequeue(&myinfo->basilisks.submitQ,0)) != 0 ) { - if ( ptr->finished == 0 ) + //if ( ptr->finished == 0 ) HASH_ADD(hh,myinfo->basilisks.issued,basilisktag,sizeof(ptr->basilisktag),ptr); - else free(ptr); + //else free(ptr); continue; } if ( (ptr= queue_dequeue(&myinfo->basilisks.resultsQ,0)) != 0 ) @@ -1016,7 +1016,7 @@ void basilisk_msgprocess(struct supernet_info *myinfo,void *_addr,uint32_t sende symbol = "BTCD"; if ( (valsobj= cJSON_Parse((char *)data)) != 0 ) { - printf("MSGVALS.(%s)\n",(char *)data); + //printf("MSGVALS.(%s)\n",(char *)data); if ( jobj(valsobj,"coin") != 0 ) coin = iguana_coinfind(jstr(valsobj,"coin")); else if ( jobj(valsobj,"symbol") != 0 ) @@ -1074,7 +1074,7 @@ void basilisk_msgprocess(struct supernet_info *myinfo,void *_addr,uint32_t sende if ( datalen > jsonlen ) { data += jsonlen, datalen -= jsonlen; - if ( strcmp("BLK",CMD) == 0 ) + if ( 0 && strcmp("BLK",CMD) == 0 ) { for (i=0; iblocks.hwmchain.height,i); } txdata.zblock.RO.allocsize = iguana_ROallocsize(virt); if ( iguana_blockvalidate(virt,&valid,(struct iguana_block *)&txdata.zblock,1) < 0 ) @@ -187,11 +187,13 @@ char *gecko_blockarrived(struct supernet_info *myinfo,struct iguana_info *virt,c adjacent = -1; for (i=0; ichain->bundlesize; i++) { + char str2[65]; + printf("scan back.%d: prev.%s hwm.%s ht.%d\n",i,bits256_str(str,prev->RO.prev_block),bits256_str(str2,virt->blocks.hwmchain.RO.hash2),virt->blocks.hwmchain.height); if ( (prev= iguana_blockfind("geckoprev",virt,prev->RO.prev_block)) == 0 ) return(clonestr("{\"error\":\"gecko block is orphan\"}")); if ( i == 0 ) adjacent = prev->height; - //printf("i.%d prevht.%d adjacent.%d hwm.%d\n",i,prev->height,adjacent,virt->blocks.hwmchain.height); + printf("i.%d prevht.%d adjacent.%d hwm.%d\n",i,prev->height,adjacent,virt->blocks.hwmchain.height); if ( prev->height >= 0 && prev->mainchain != 0 ) { if ( (adjacent + 1) > virt->blocks.hwmchain.height ) // longest chain wins