From 62561ba50aed4309f5f86fa12d70ce859ec05ea3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 30 Mar 2016 07:18:35 -0300 Subject: [PATCH] test --- iguana/iguana777.h | 2 +- iguana/iguana_bundles.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/iguana/iguana777.h b/iguana/iguana777.h index afa2f32ca..dfb773cfd 100755 --- a/iguana/iguana777.h +++ b/iguana/iguana777.h @@ -43,7 +43,7 @@ typedef int32_t (*blockhashfunc)(uint8_t *blockhashp,uint8_t *serialized,int32_t #define IGUANA_TAILPERCENTAGE 1.0 #define IGUANA_MAXPENDHDRS 1 #define IGUANA_MAXPENDINGREQUESTS 128 -#define IGUANA_PENDINGREQUESTS 32 +#define IGUANA_PENDINGREQUESTS 512 #define IGUANA_MINPENDBUNDLES 2 #define IGUANA_MAXPENDBUNDLES 64 #define IGUANA_BUNDLELOOP 77 diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index 0910d3506..7dc241b86 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -474,12 +474,12 @@ int32_t iguana_blocksmissing(struct iguana_info *coin,int32_t *nonzp,uint8_t mis int32_t iguana_sendhashes(struct iguana_info *coin,struct iguana_peer *addr,int32_t msgtype,bits256 hashes[],int32_t n) { - int32_t len; uint8_t serialized[(sizeof(int32_t) + sizeof(*hashes))*IGUANA_PENDINGREQUESTS + 1024]; + 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) ) { - printf("iguana_sendhashes: len.%d size.%ld\n",len,sizeof(serialized)); + printf("FATAL ERROR iguana_sendhashes: len.%d size.%ld\n",len,sizeof(serialized)); exit(-1); } iguana_send(coin,addr,serialized,len); @@ -488,6 +488,7 @@ int32_t iguana_sendhashes(struct iguana_info *coin,struct iguana_peer *addr,int3 addr->pendtime = (uint32_t)time(NULL); //printf("sendhashes[%d] -> %s\n",n,addr->ipaddr); } else n = 0; + free(serialized); return(n); }