Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
fbc0eda896
  1. 2
      iguana/iguana_msg.c
  2. 8
      iguana/iguana_recv.c
  3. 2
      iguana/main.c

2
iguana/iguana_msg.c

@ -186,7 +186,7 @@ void iguana_gotaddr(struct iguana_info *coin,struct iguana_peer *addr,struct igu
if ( port != 0 )
sprintf(ipport,"%s:%d",ipaddr,port);
iguana_possible_peer(coin,ipport);
printf("gotaddr.(%s:%d)\n",ipaddr,port);
//printf("gotaddr.(%s:%d)\n",ipaddr,port);
}
void iguana_gotping(struct iguana_info *coin,struct iguana_peer *addr,uint64_t nonce,uint8_t *data)

8
iguana/iguana_recv.c

@ -53,7 +53,7 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr,
coin->numreqsent++;
addr->pendblocks++;
addr->pendtime = (uint32_t)time(NULL);
printf("REQ.%s bundlei.%d hdrsi.%d\n",bits256_str(hexstr,hash2),bundlei,bp!=0?bp->hdrsi:-1);
// printf("REQ.%s bundlei.%d hdrsi.%d\n",bits256_str(hexstr,hash2),bundlei,bp!=0?bp->hdrsi:-1);
} else printf("MSG_BLOCK null datalen.%d\n",len);
return(len);
}
@ -522,7 +522,7 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct iguana_info *coin,struct
int32_t bundlei,i; struct iguana_bundle *bp;// struct iguana_block *block;
bp = 0, bundlei = -2;
iguana_bundlefind(coin,&bp,&bundlei,blockhashes[1]);
char str[65]; printf("blockhashes[%d] %d of %d %s bp.%d[%d]\n",num,bp==0?-1:bp->hdrsi,coin->bundlescount,bits256_str(str,blockhashes[1]),bp==0?-1:bp->bundleheight,bundlei);
// char str[65]; printf("blockhashes[%d] %d of %d %s bp.%d[%d]\n",num,bp==0?-1:bp->hdrsi,coin->bundlescount,bits256_str(str,blockhashes[1]),bp==0?-1:bp->bundleheight,bundlei);
if ( bp != 0 )
{
bp->hdrtime = (uint32_t)time(NULL);
@ -576,7 +576,7 @@ struct iguana_bundlereq *iguana_recvblock(struct iguana_info *coin,struct iguana
{
struct iguana_bundle *bp=0; int32_t bundlei = -2; struct iguana_block *block;
bp = iguana_bundleset(coin,&block,&bundlei,origblock);
static int total; char str[65]; printf("RECV %s [%d:%d] block.%08x | %d\n",bits256_str(str,origblock->RO.hash2),bp!=0?bp->hdrsi:-1,bundlei,block->fpipbits,total++);
//static int total; char str[65]; printf("RECV %s [%d:%d] block.%08x | %d\n",bits256_str(str,origblock->RO.hash2),bp!=0?bp->hdrsi:-1,bundlei,block->fpipbits,total++);
if ( block != 0 )
{
block->RO.recvlen = recvlen;
@ -799,7 +799,7 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr)
}
//if ( bp == 0 || z != 0 )
{
printf("%s request HDR.(%s) numhashes.%d\n",addr!=0?addr->ipaddr:"local",hashstr,bp->numhashes);
//printf("%s request HDR.(%s) numhashes.%d\n",addr!=0?addr->ipaddr:"local",hashstr,bp->numhashes);
iguana_send(coin,addr,serialized,datalen);
addr->pendhdrs++;
flag++;

2
iguana/main.c

@ -448,7 +448,7 @@ void iguana_main(void *arg)
signal(SIGINT,sigint_func);
signal(SIGILL,sigillegal_func);
signal(SIGHUP,sighangup_func);
signal(SIGKILL,sigkill_func);
//signal(SIGKILL,sigkill_func);
signal(SIGABRT,sigabort_func);
signal(SIGQUIT,sigquit_func);
signal(SIGCHLD,sigchild_func);

Loading…
Cancel
Save