diff --git a/.gitignore b/.gitignore index 5bb42d365..92b11bd00 100755 --- a/.gitignore +++ b/.gitignore @@ -34,4 +34,6 @@ agents/* iguana/confs/BTC_hdrs.txt +deprecated/.DS_Store + .DS_Store diff --git a/crypto777/jpeg/unix/jmemname.c b/crypto777/jpeg/unix/jmemname.c index 423476507..9db4408eb 100755 --- a/crypto777/jpeg/unix/jmemname.c +++ b/crypto777/jpeg/unix/jmemname.c @@ -11,7 +11,6 @@ * Also, the problem of determining the amount of memory available * is shoved onto the user. */ - #ifndef WIN32 #include #endif diff --git a/iguana/coins/genbtcd b/iguana/coins/genbtcd index d06997995..48fea130b 100755 --- a/iguana/coins/genbtcd +++ b/iguana/coins/genbtcd @@ -1 +1 @@ -curl --url "http://127.0.0.1:7778" --data "{\"prefetchlag\":11,\"poll\":50,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTCD\",\"startpend\":512,\"endpend\":512,\"services\":129,\"maxpeers\":512,\"RELAY\":1,\"VALIDATE\":1,\"portp2p\":14631,\"rpc\":14632,\"minconfirms\":5}" +curl --url "http://127.0.0.1:7778" --data "{\"prefetchlag\":11,\"poll\":50,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTCD\",\"startpend\":512,\"endpend\":512,\"services\":129,\"maxpeers\":512,\"RELAY\":1,\"VALIDATE\":1,\"portp2p\":14631,\"rpc\":14632,\"minconfirms\":5}" diff --git a/iguana/iguana.vcxproj b/iguana/iguana.vcxproj new file mode 100644 index 000000000..6bb9c2eaa --- /dev/null +++ b/iguana/iguana.vcxproj @@ -0,0 +1,297 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {80F58B93-D1FC-4FC4-A880-1F40A1FC851B} + Win32Proj + ConsoleApplication3 + 8.1 + iguana + + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + + + Level2 + Disabled + _CRT_SECURE_NO_WARNINGS;NATIVE_WINDOWS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 1Byte + + + Console + true + Ws2_32.lib;%(AdditionalDependencies) + + + + + + + Level3 + Disabled + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 1Byte + + + Console + true + + + + + Level3 + + + MaxSpeed + true + true + _CRT_SECURE_NO_WARNINGS;NATIVE_WINDOWS;WIN32;_CONSOLE;NDEBUG;%(PreprocessorDefinitions) + + + Console + true + true + true + Ws2_32.lib;%(AdditionalDependencies) + + + + + Level3 + + + MaxSpeed + true + true + _CRT_SECURE_NO_WARNINGS;NATIVE_WINDOWS;WIN32;_CONSOLE;NDEBUG;%(PreprocessorDefinitions) + 1Byte + + + Console + true + true + true + Ws2_32.lib;%(AdditionalDependencies) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iguana/iguana.vcxproj.filters b/iguana/iguana.vcxproj.filters new file mode 100644 index 000000000..da9ab88db --- /dev/null +++ b/iguana/iguana.vcxproj.filters @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/iguana/iguana_blocks.c b/iguana/iguana_blocks.c index 7ff74e3e8..e908e6b12 100755 --- a/iguana/iguana_blocks.c +++ b/iguana/iguana_blocks.c @@ -566,6 +566,8 @@ struct iguana_block *_iguana_chainlink(struct supernet_info *myinfo,struct iguan { int32_t valid,bundlei,height=-1; struct iguana_block *hwmchain,*block = 0,*prev=0; bits256 *hash2p=0; double prevPoW = 0.; + if ( coin->blocks.hwmchain.height < 0 ) + iguana_genesis(myinfo,coin,coin->chain); if ( newblock == 0 || newblock->RO.timestamp == 0 || bits256_nonz(newblock->RO.prev_block) == 0 ) return(0); iguana_blocksizecheck("chainlink new",coin->chain->zcash,newblock); diff --git a/iguana/iguana_peers.c b/iguana/iguana_peers.c index 01d82f41e..6323e0d74 100755 --- a/iguana/iguana_peers.c +++ b/iguana/iguana_peers.c @@ -367,14 +367,14 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port) } saddr.sin_family = AF_INET; saddr.sin_port = htons(port); - //#ifdef WIN32 - // saddr.sin_addr.s_addr = (uint32_t)calc_ipbits("127.0.0.1"); - //#else +//#ifdef WIN32 +// saddr.sin_addr.s_addr = (uint32_t)calc_ipbits("127.0.0.1"); +//#else memcpy(&saddr.sin_addr.s_addr,hostent->h_addr_list[0],hostent->h_length); expand_ipbits(checkipaddr,saddr.sin_addr.s_addr); if ( strcmp(ipaddr,checkipaddr) != 0 ) printf("bindflag.%d iguana_socket mismatch (%s) -> (%s)?\n",bindflag,checkipaddr,ipaddr); - //#endif +//#endif if ( (sock= socket(AF_INET,SOCK_STREAM,0)) < 0 ) { if ( errno != ETIMEDOUT ) @@ -434,7 +434,7 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port) } sleep(13); //continue; - } + } if ( errno != ECONNRESET && errno != ENOTCONN && errno != ECONNREFUSED && errno != ETIMEDOUT && errno != EHOSTUNREACH ) { printf("%s(%s) port.%d failed: %s sock.%d. errno.%d\n",bindflag!=0?"bind":"connect",hostname,port,strerror(errno),sock,errno); @@ -507,28 +507,28 @@ int32_t iguana_send(struct iguana_info *coin,struct iguana_peer *addr,uint8_t *s #else if ( (numsent= (int32_t)send(usock,serialized,remains,MSG_NOSIGNAL)) < 0 ) #endif + { + if ( errno == EAGAIN || errno == EWOULDBLOCK ) { - if ( errno == EAGAIN || errno == EWOULDBLOCK ) - { - //addr->persistent_peer = 1; - sleep(1); - continue; - } - //if ( errno != EAGAIN && errno != EWOULDBLOCK ) - { - printf("%s: %s numsent.%d vs remains.%d len.%d errno.%d (%s) usock.%d\n",serialized+4,addr->ipaddr,numsent,remains,len,errno,strerror(errno),addr->usock); - printf("bad errno.%d %s zombify.%p\n",errno,strerror(errno),&addr->dead); - addr->dead = (uint32_t)time(NULL); - return(-errno); - } + //addr->persistent_peer = 1; + sleep(1); + continue; } - else if ( remains > 0 ) + //if ( errno != EAGAIN && errno != EWOULDBLOCK ) { - remains -= numsent; - serialized += numsent; - if ( remains > 0 ) - printf("%s iguana sent.%d remains.%d of len.%d\n",addr->ipaddr,numsent,remains,len); + printf("%s: %s numsent.%d vs remains.%d len.%d errno.%d (%s) usock.%d\n",serialized+4,addr->ipaddr,numsent,remains,len,errno,strerror(errno),addr->usock); + printf("bad errno.%d %s zombify.%p\n",errno,strerror(errno),&addr->dead); + addr->dead = (uint32_t)time(NULL); + return(-errno); } + } + else if ( remains > 0 ) + { + remains -= numsent; + serialized += numsent; + if ( remains > 0 ) + printf("%s iguana sent.%d remains.%d of len.%d\n",addr->ipaddr,numsent,remains,len); + } } addr->totalsent += len; if ( 0 && addr->basilisk != 0 ) @@ -691,7 +691,7 @@ void _iguana_processmsg(struct supernet_info *myinfo,struct iguana_info *coin,in } //addr->dead = 1; } - // printf("%s recv error on hdr errno.%d (%s) -> zombify\n",addr->ipaddr,-recvlen,strerror(-recvlen)); + // printf("%s recv error on hdr errno.%d (%s) -> zombify\n",addr->ipaddr,-recvlen,strerror(-recvlen)); #ifndef IGUANA_DEDICATED_THREADS addr->dead = 1; #endif @@ -892,7 +892,7 @@ void *iguana_iAddriterator(struct iguana_info *coin,struct iguana_iAddr *iA,stru //else printf("connector null iA\n"); return(0); } - + uint32_t iguana_possible_peer(struct iguana_info *coin,char *ipaddr) { char checkaddr[64],_ipaddr[64]; uint64_t ipbits; uint32_t now = (uint32_t)time(NULL); int32_t i,n; struct iguana_iAddr *iA; struct iguana_peer *addr; @@ -905,7 +905,7 @@ uint32_t iguana_possible_peer(struct iguana_info *coin,char *ipaddr) for (i=n=0; ipeers->active[i].ipaddr) == 0 ) { - //printf("%s possible peer.(%s) %x already there\n",coin->symbol,ipaddr,(uint32_t)coin->peers->active[i].ipbits); + printf("%s possible peer.(%s) %x already there\n",coin->symbol,ipaddr,(uint32_t)coin->peers->active[i].ipbits); return(0); } //printf("%s Q possible.(%s)\n",coin->symbol,ipaddr); @@ -927,12 +927,12 @@ uint32_t iguana_possible_peer(struct iguana_info *coin,char *ipaddr) if ( (addr= iguana_peerslot(coin,(uint32_t)ipbits,0)) == 0 ) return((uint32_t)time(NULL)); /*for (i=n=0; ipeers->active[i].ipaddr) == 0 ) - return((uint32_t)time(NULL)); - else if ( coin->peers->active[i].ipaddr[0] != 0 ) - n++; - }*/ + { + if ( strcmp(ipaddr,coin->peers->active[i].ipaddr) == 0 ) + return((uint32_t)time(NULL)); + else if ( coin->peers->active[i].ipaddr[0] != 0 ) + n++; + }*/ n = coin->peers->numranked; if ( n >= coin->MAXPEERS-(coin->MAXPEERS>>3)-1 || coin->peers->numranked >= coin->MAXPEERS ) return((uint32_t)time(NULL)); @@ -1202,7 +1202,7 @@ void iguana_dedicatedloop(struct supernet_info *myinfo,struct iguana_info *coin, iguana_memreset(mem[i]); } #endif - //addr->pubkey = GENESIS_PUBKEY; + //addr->pubkey = GENESIS_PUBKEY; ipbits = (uint32_t)addr->ipbits; vcalc_sha256(0,addr->iphash.bytes,(uint8_t *)&ipbits,sizeof(ipbits)); //char str[65]; printf("start dedicatedloop.%s addrind.%d %s\n",addr->ipaddr,addr->addrind,bits256_str(str,addr->iphash)); @@ -1292,10 +1292,10 @@ void iguana_dedicatedloop(struct supernet_info *myinfo,struct iguana_info *coin, if ( flag != 0 ) run = 0; /*else if ( 0 && addr->supernet != 0 && time(NULL) > lastping+SUPERNET_PINGGAP ) - { - iguana_send_supernet(addr,SUPERNET_GETPEERSTR,0); - lastping = (uint32_t)time(NULL); - }*/ + { + iguana_send_supernet(addr,SUPERNET_GETPEERSTR,0); + lastping = (uint32_t)time(NULL); + }*/ if ( addr->persistent_peer != 0 ) { if ( addr->usock < 0 || addr->dead != 0 ) diff --git a/iguana/iguana_realtime.c b/iguana/iguana_realtime.c index 6517257a5..ee161b72c 100755 --- a/iguana/iguana_realtime.c +++ b/iguana/iguana_realtime.c @@ -767,12 +767,12 @@ void iguana_RTnewblock(struct supernet_info *myinfo,struct iguana_info *coin,str } iguana_RTbalance_verify("start iterate",coin); /*if ( strcmp(coin->symbol,"BTC") != 0 && strcmp(coin->symbol,"LTC") != 0 ) - { - if ( block->height < coin->firstRTheight+coin->minconfirms ) - return; - if ( (block= iguana_blockfind("RTnew",coin,iguana_blockhash(coin,block->height-coin->minconfirms))) == 0 ) - return; - }*/ + { + if ( block->height < coin->firstRTheight+coin->minconfirms ) + return; + if ( (block= iguana_blockfind("RTnew",coin,iguana_blockhash(coin,block->height-coin->minconfirms))) == 0 ) + return; + }*/ if ( block->height < coin->firstRTheight || block->height >= coin->firstRTheight+sizeof(coin->RTblocks)/sizeof(*coin->RTblocks) ) { if ( 0 && coin->firstRTheight > 0 ) @@ -842,24 +842,24 @@ void iguana_RTnewblock(struct supernet_info *myinfo,struct iguana_info *coin,str char str[65]; printf("reorg RTheight.%d vs block.%d %s\n",coin->RTheight,block->height,bits256_str(str,block->RO.hash2)); iguana_RTreset(coin); /*while ( coin->RTheight > block->height ) - { - if ( iguana_RTblocksub(myinfo,coin,iguana_RTblock(coin,coin->RTheight-1)) < 0 ) - { - printf("error subtracting %d\n",coin->RTheight-1); - coin->lastRTheight = coin->RTheight-1; - portable_mutex_unlock(&coin->RTmutex); - return; - } - coin->RTheight--; - } - if ( iguana_RTblockadd(myinfo,coin,block) < 0 ) - { - printf("error adding %d\n",block->height); - portable_mutex_unlock(&coin->RTmutex); - return; - } - coin->lastRTheight = block->height; - coin->RTheight = coin->lastRTheight+1;*/ + { + if ( iguana_RTblocksub(myinfo,coin,iguana_RTblock(coin,coin->RTheight-1)) < 0 ) + { + printf("error subtracting %d\n",coin->RTheight-1); + coin->lastRTheight = coin->RTheight-1; + portable_mutex_unlock(&coin->RTmutex); + return; + } + coin->RTheight--; + } + if ( iguana_RTblockadd(myinfo,coin,block) < 0 ) + { + printf("error adding %d\n",block->height); + portable_mutex_unlock(&coin->RTmutex); + return; + } + coin->lastRTheight = block->height; + coin->RTheight = coin->lastRTheight+1;*/ } portable_mutex_unlock(&coin->RTmutex); } diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index c35b488ec..9126f6708 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -93,10 +93,10 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr, if ( block->mainchain != 0 && block->valid != 0 && block->txvalid != 0 ) { /*if ( (bp= coin->bundles[block->bundlei]) != 0 ) - { - bp->hashes[block->bundlei] = block->RO.hash2; - bp->blocks[block->bundlei] = block; - }*/ + { + bp->hashes[block->bundlei] = block->RO.hash2; + bp->blocks[block->bundlei] = block; + }*/ return(0); } } @@ -194,7 +194,7 @@ struct iguana_txblock *iguana_peertxdata(struct iguana_info *coin,int32_t *bundl int32_t bundlei,datalen,checki,hdrsi,fpos; char str[65],str2[65]; FILE *fp; bits256 checkhash2; struct iguana_txblock *txdata = 0; static const bits256 zero; if ( (bundlei= iguana_peerfname(coin,&hdrsi,GLOBAL_TMPDIR,fname,ipbits,hash2,zero,1)) >= 0 ) - //if ( (bundlei= iguana_peerfname(coin,&hdrsi,fname,ipbits,hash2)) >= 0 ) + //if ( (bundlei= iguana_peerfname(coin,&hdrsi,fname,ipbits,hash2)) >= 0 ) { if ( (fp= fopen(fname,"rb")) != 0 ) { @@ -500,7 +500,7 @@ void iguana_oldgotblockM(struct supernet_info *myinfo,struct iguana_info *coin,s txdata->zblock.fpos = 0; req->datalen = txdata->datalen; req->ipbits = txdata->zblock.fpipbits; - } //else printf("cant save block\n"); + } //else printf("cant save block\n"); } if ( txdata->zblock.fpos == 0 ) { @@ -526,7 +526,7 @@ void iguana_oldgotblockM(struct supernet_info *myinfo,struct iguana_info *coin,s } req->addr = addr; //if ( (bits256_cmp(origtxdata->zblock.RO.hash2,coin->blocks.hwmchain.RO.hash2) == 0 || req->zblock.mainchain == 0 || req->zblock.valid == 0 || req->zblock.txvalid == 0) && iguana_RTrawdata(coin,origtxdata->zblock.RO.hash2,0,&len,&numtx,1) == 0 ) - queue_enqueue("recvQ",&coin->recvQ,&req->DL,0); + queue_enqueue("recvQ",&coin->recvQ,&req->DL,0); if ( 0 && strcmp("BTCD",coin->symbol) == 0 ) printf("%s Q.(%s)\n",coin->symbol,bits256_str(str,origtxdata->zblock.RO.hash2)); } else printf("nonz fpos.%d %s\n",txdata->zblock.fpos,bits256_str(str,origtxdata->zblock.RO.hash2)); @@ -887,7 +887,6 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru { req = iguana_recv_bundlereq(coin,addr,0,H,data,recvlen,0,-1,origtxdata); queue_enqueue("recvQ",&coin->recvQ,&req->DL,0); - //printf("nonz fpos.%d %s\n",txdata->zblock.fpos,bits256_str(str,origtxdata->zblock.RO.hash2)); } } @@ -993,7 +992,7 @@ void iguana_gotblockhashesM(struct iguana_info *coin,struct iguana_peer *addr,bi if ( 0 && coin->RTheight > 0 ) { for (i=1; iRTheight > 0 && newheight == coin->RTheight ) { //printf("newheight.%d is RTheight\n",newheight); - } + } } //if ( 0 && bits256_nonz(prevhash2) > 0 ) // iguana_patch(coin,block); @@ -1407,13 +1406,13 @@ struct iguana_bundlereq *iguana_recvblockhdrs(struct supernet_info *myinfo,struc if ( 0 && bp == coin->current ) printf("i.%d n.%d match.%d blockhdrs.%s hdrsi.%d\n",i,n,match,bits256_str(str,zblocks[0].RO.hash2),firstbp!=0?firstbp->hdrsi:-1); /*if ( firstbp != 0 && match >= coin->chain->bundlesize-1 ) - { - if ( firstbp->queued == 0 ) - { - //fprintf(stderr,"firstbp blockQ %d\n",firstbp->bundleheight); - iguana_bundleQ(myinfo,coin,firstbp,1000); - } - }*/ + { + if ( firstbp->queued == 0 ) + { + //fprintf(stderr,"firstbp blockQ %d\n",firstbp->bundleheight); + iguana_bundleQ(myinfo,coin,firstbp,1000); + } + }*/ if ( firstbp != 0 && (addr= req->addr) != 0 && n >= coin->chain->bundlesize ) { addr->RThashes[0] = firstbp->hashes[0]; @@ -1583,13 +1582,13 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct supernet_info *myinfo,str //printf("set block->blockhashes[%d]\n",num); } /*if ( (addr= coin->peers->ranked[0]) != 0 ) - { - if ( (len= iguana_getdata(coin,serialized,MSG_BLOCK,&blockhashes[1],1)) > 0 ) - { - iguana_send(coin,addr,serialized,len); - //char str[65]; printf("REQ.%s\n",bits256_str(str,blockhashes[1])); - } - }*/ + { + if ( (len= iguana_getdata(coin,serialized,MSG_BLOCK,&blockhashes[1],1)) > 0 ) + { + iguana_send(coin,addr,serialized,len); + //char str[65]; printf("REQ.%s\n",bits256_str(str,blockhashes[1])); + } + }*/ iguana_blockQ("hdr1",coin,0,-1,blockhashes[1],1); } else @@ -1698,7 +1697,7 @@ struct iguana_bundlereq *iguana_recvblock(struct supernet_info *myinfo,struct ig if ( (tmpblock= bp->blocks[i]) != 0 && tmpblock->fpipbits != 0 && tmpblock->fpos >= 0 && ((bp->hdrsi == 0 && i == 0) || bits256_nonz(tmpblock->RO.prev_block) != 0) ) numsaved++; } - // fprintf(stderr,"%s [%d:%d] block.%x | s.%d r.%d copy.%d mainchain.%d\n",bits256_str(str,origblock->RO.hash2),bp!=0?bp->hdrsi:-1,bundlei,block!=0?block->fpipbits:0,numsaved,numrecv,req!=0?req->copyflag:-1,block->mainchain); + // fprintf(stderr,"%s [%d:%d] block.%x | s.%d r.%d copy.%d mainchain.%d\n",bits256_str(str,origblock->RO.hash2),bp!=0?bp->hdrsi:-1,bundlei,block!=0?block->fpipbits:0,numsaved,numrecv,req!=0?req->copyflag:-1,block->mainchain); if ( _iguana_chainlink(myinfo,coin,block) == 0 ) { next = block; @@ -1794,11 +1793,11 @@ int32_t iguana_reqblocks(struct supernet_info *myinfo,struct iguana_info *coin) if ( (bp= coin->bundles[hdrsi]) != 0 ) { /*for (bundlei=0; bundleichain->bundlesize; bundlei++) - if ( (block= bp->blocks[bundlei]) != 0 && bits256_cmp(block->RO.hash2,bp->hashes[bundlei]) != 0 && bits256_nonz(bp->hashes[bundlei]) != 0 ) - { - char str[65]; printf("%s [%d] bundlei.%d ht.%d vs expected %d\n",bits256_str(str,bp->hashes[bundlei]),hdrsi,bundlei,block->height,bp->bundleheight+bundlei); - bp->blocks[bundlei] = iguana_blockfind("fixit",coin,bp->hashes[bundlei]); - }*/ + if ( (block= bp->blocks[bundlei]) != 0 && bits256_cmp(block->RO.hash2,bp->hashes[bundlei]) != 0 && bits256_nonz(bp->hashes[bundlei]) != 0 ) + { + char str[65]; printf("%s [%d] bundlei.%d ht.%d vs expected %d\n",bits256_str(str,bp->hashes[bundlei]),hdrsi,bundlei,block->height,bp->bundleheight+bundlei); + bp->blocks[bundlei] = iguana_blockfind("fixit",coin,bp->hashes[bundlei]); + }*/ bundlei = (coin->blocks.hwmchain.height+1) % coin->chain->bundlesize; if ( (next= bp->blocks[bundlei]) != 0 || (next= iguana_blockfind("reqblocks",coin,bp->hashes[bundlei])) != 0 ) { @@ -1962,10 +1961,10 @@ int32_t iguana_processrecvQ(struct supernet_info *myinfo,struct iguana_info *coi myfree(req->hashes,(req->n+1) * sizeof(*req->hashes)), req->hashes = 0; } /*else if ( req->type == 'Q' ) // quotes from inv - { - if ( (req= instantdex_recvquotes(coin,req,req->hashes,req->n)) != 0 ) - myfree(req->hashes,(req->n+1) * sizeof(*req->hashes)), req->hashes = 0; - }*/ + { + if ( (req= instantdex_recvquotes(coin,req,req->hashes,req->n)) != 0 ) + myfree(req->hashes,(req->n+1) * sizeof(*req->hashes)), req->hashes = 0; + }*/ else printf("iguana_updatebundles unknown type.%c\n",req->type);//, getchar(); //fprintf(stderr,"finished coin->recvQ\n"); if ( req != 0 ) @@ -1977,7 +1976,7 @@ int32_t iguana_processrecvQ(struct supernet_info *myinfo,struct iguana_info *coi int32_t iguana_needhdrs(struct iguana_info *coin) { //if ( coin->longestchain == 0 || coin->blocks.hashblocks < coin->longestchain-coin->chain->bundlesize ) - return(1); + return(1); //else return(0); } @@ -2053,7 +2052,7 @@ int32_t iguana_blockQ(char *argstr,struct iguana_info *coin,struct iguana_bundle //printf("found valid [%d:%d] in blockQ\n",block!=0?block->hdrsi:-1,block!=0?block->bundlei:-1); return(0); } - //lag = (priority == 0) ? IGUANA_DEFAULTLAG*3 : IGUANA_DEFAULTLAG; + //lag = (priority == 0) ? IGUANA_DEFAULTLAG*3 : IGUANA_DEFAULTLAG; now = (uint32_t)time(NULL); block = iguana_blockfind("blockQ",coin,hash2); if ( priority != 0 || block == 0 )//|| iguana_blockstatus(coin,block) == 0 ) @@ -2262,7 +2261,7 @@ int32_t iguana_processrecv(struct supernet_info *myinfo,struct iguana_info *coin coin->disableUTXO = 1; //iguana_utxoupdate(coin,-1,0,0,0,0,-1,0); // free hashtables if ( iguana_balanceflush(myinfo,coin,coin->balanceflush) > 0 ) - printf("balanceswritten.%d flushed coin->balanceflush %d vs %d coin->longestchain/coin->chain->bundlesize\n",coin->balanceswritten,coin->balanceflush,coin->longestchain/coin->chain->bundlesize); + printf("balanceswritten.%d flushed coin->balanceflush %d vs %d coin->longestchain/coin->chain->bundlesize\n",coin->balanceswritten,coin->balanceflush,coin->longestchain/coin->chain->bundlesize); //portable_mutex_unlock(&coin->RTmutex); coin->disableUTXO = 0; fprintf(stderr,"%s back balanceflush\n",coin->symbol); diff --git a/iguana/pthreadVC2.lib b/iguana/pthreadVC2.lib new file mode 100644 index 000000000..d793e7144 Binary files /dev/null and b/iguana/pthreadVC2.lib differ diff --git a/iguana/pthreadvc2.dll b/iguana/pthreadvc2.dll new file mode 100644 index 000000000..93f562baa Binary files /dev/null and b/iguana/pthreadvc2.dll differ