Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
6770427bae
  1. 4
      iguana/iguana_bundles.c
  2. 2
      iguana/iguana_recv.c

4
iguana/iguana_bundles.c

@ -477,9 +477,9 @@ int32_t iguana_sendhashes(struct iguana_info *coin,struct iguana_peer *addr,int3
int32_t len; uint8_t *serialized = malloc((sizeof(int32_t) + sizeof(*hashes))*n + 1024);
if ( (len= iguana_getdata(coin,serialized,MSG_BLOCK,hashes,n)) > 0 )
{
if ( len > sizeof(serialized) )
if ( len > (sizeof(int32_t) + sizeof(*hashes))*n + 1024 )
{
printf("FATAL ERROR iguana_sendhashes: len.%d size.%ld\n",len,sizeof(serialized));
printf("FATAL ERROR iguana_sendhashes: len.%d size.%ld\n",len,(sizeof(int32_t) + sizeof(*hashes))*n + 1024);
exit(-1);
}
iguana_send(coin,addr,serialized,len);

2
iguana/iguana_recv.c

@ -826,7 +826,7 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct iguana_info *coin,struct
{
bp->speculative[i] = blockhashes[i];
//printf("speculate new issue [%d:%d]\n",bp->hdrsi,i);
iguana_blockQ("speculate",coin,bp,-i,blockhashes[i],0);
//iguana_blockQ("speculate",coin,bp,-i,blockhashes[i],0);
}
bp->speculative[0] = bp->hashes[0];
bp->numspec = num <= bp->n+1 ? num : bp->n+1;

Loading…
Cancel
Save