diff --git a/iguana/iguana777.h b/iguana/iguana777.h index 2dbc5b6b6..68c16b396 100755 --- a/iguana/iguana777.h +++ b/iguana/iguana777.h @@ -18,7 +18,7 @@ #include "../crypto777/OS_portable.h" #include "SuperNET.h" -#define IGUANA_DISABLEPEERS +//#define IGUANA_DISABLEPEERS #define IGUANA_MAXCOINS 64 #define IGUANA_MAXDELAY_MILLIS (3600 * 1000) diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 9ef2f136c..77c44b207 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -50,6 +50,11 @@ int32_t iguana_sendblockreq(struct iguana_info *coin,struct iguana_peer *addr,st { int32_t len; uint8_t serialized[sizeof(struct iguana_msghdr) + sizeof(uint32_t)*32 + sizeof(bits256)]; char hexstr[65]; init_hexbytes_noT(hexstr,hash2.bytes,sizeof(hash2)); + if ( addr->msgcounts.verack == 0 ) + { + printf("iguana_sendblockreq %s hasn't verack'ed yet\n"); + return(-1); + } if ( (len= iguana_getdata(coin,serialized,MSG_BLOCK,hexstr)) > 0 ) { iguana_send(coin,addr,serialized,len); @@ -671,6 +676,8 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr) hashstr = 0; } } + if ( addr->msgcounts.verack == 0 ) + return(0); if ( (limit= addr->recvblocks) > coin->MAXPENDING ) limit = coin->MAXPENDING; if ( limit < 1 ) @@ -678,7 +685,7 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr) //if ( addr->pendblocks >= limit ) // printf("%s %d overlimit.%d\n",addr->ipaddr,addr->pendblocks,limit); req = queue_dequeue(&coin->priorityQ,0); - if ( 1 && coin->bundlescount > 0 && req == 0 )//addr->pendblocks < limit )//&& now > addr->lastpoll ) + if ( addr->msgcounts.verack > 0 && coin->bundlescount > 0 && req == 0 )//addr->pendblocks < limit )//&& now > addr->lastpoll ) { if ( 1 )//strcmp("BTC",coin->symbol) != 0 ) {