Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
79627eb2a6
  1. 2
      iguana/iguana_peers.c
  2. 3
      iguana/iguana_realtime.c
  3. 2
      iguana/iguana_recv.c

2
iguana/iguana_peers.c

@ -631,7 +631,7 @@ void _iguana_processmsg(struct iguana_info *coin,int32_t usock,struct iguana_pee
buf = mycalloc('p',1,len);
if ( (recvlen= iguana_recv(addr->ipaddr,usock,buf,len)) < 0 )
{
printf("recv error on (%s) len.%d errno.%d (%s)\n",H.command,len,-recvlen,strerror(-recvlen));
printf("%s recv error on (%s) len.%d errno.%d (%s)\n",addr->ipaddr,H.command,len,-recvlen,strerror(-recvlen));
if ( buf != _buf )
myfree(buf,len);
//addr->dead = (uint32_t)time(NULL);

3
iguana/iguana_realtime.c

@ -600,6 +600,7 @@ void iguana_RTblockadd(struct iguana_info *coin,struct iguana_block *block)
if ( coin->RTrawdata[offset] == 0 )
coin->RTrawdata[offset] = iguana_RTrawdata(coin,block->RO.hash2,0,&coin->RTrecvlens[offset],&coin->RTnumtx[offset]);
//printf("%s RTblockadd.%d offset.%d numtx.%d len.%d\n",coin->symbol,block->height,offset,coin->RTnumtx[offset],coin->RTrecvlens[offset]);
block->RO.txn_count = coin->RTnumtx[offset];
coin->RTblocks[offset] = block;
iguana_RTiterate(coin,offset,block,1);
}
@ -611,12 +612,14 @@ void iguana_RTblocksub(struct iguana_info *coin,struct iguana_block *block)
if ( block != 0 )
{
offset = block->height - coin->firstRTheight;
block->RO.txn_count = coin->RTnumtx[offset];
//printf("%s RTblocksub.%d offset.%d\n",coin->symbol,block->height,offset);
iguana_RTiterate(coin,offset,block,-1);
if ( coin->RTrawdata[offset] != 0 && coin->RTrecvlens[offset] != 0 )
iguana_RTunmap(coin->RTrawdata[offset],coin->RTrecvlens[offset]);
coin->RTrawdata[offset] = 0;
coin->RTrecvlens[offset] = 0;
coin->RTnumtx[offset] = 0;
coin->RTblocks[offset] = 0;
}
}

2
iguana/iguana_recv.c

@ -68,7 +68,7 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr,
if ( addr == 0 || memcmp(lastreq.bytes,hash2.bytes,sizeof(hash2)) == 0 || memcmp(lastreq2.bytes,hash2.bytes,sizeof(hash2)) == 0 )
{
//printf("duplicate req %s or null addr.%p\n",bits256_str(hexstr,hash2),addr);
if ( (rand() % 10 ) != 0 )
//if ( (rand() % 10 ) != 0 )
return(0);
}
if ( addr->usock < 0 )

Loading…
Cancel
Save