From ca7edb088843764f9de1567ba4dabe351848cb5c Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 6 Mar 2016 21:45:45 -0300 Subject: [PATCH] test --- crypto777/iguana_OS.c | 2 +- iguana/iguana777.c | 4 +-- iguana/iguana777.h | 19 ++++++------- iguana/iguana_bundles.c | 60 ++++++++++++++++++++++++++++++++++------ iguana/iguana_ramchain.c | 25 +++++++++-------- iguana/iguana_recv.c | 26 ++++++++++++----- iguana/iguana_scripts.c | 12 +++++--- iguana/main.c | 6 ++-- 8 files changed, 107 insertions(+), 47 deletions(-) diff --git a/crypto777/iguana_OS.c b/crypto777/iguana_OS.c index 9d6955600..4e5821426 100755 --- a/crypto777/iguana_OS.c +++ b/crypto777/iguana_OS.c @@ -248,7 +248,7 @@ void *queue_dequeue(queue_t *queue,int32_t offsetflag) if ( queue->list != 0 ) { item = queue->list; - printf("queue_dequeue name.(%s) dequeue.%p list.%p\n",queue->name,item,queue->list); + //printf("queue_dequeue name.(%s) dequeue.%p list.%p\n",queue->name,item,queue->list); DL_DELETE(queue->list,item); } portable_mutex_unlock(&queue->mutex); diff --git a/iguana/iguana777.c b/iguana/iguana777.c index a2c2f48c1..bfb30ee81 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -374,14 +374,14 @@ void iguana_coinloop(void *arg) coin->chain->minconfirms = coin->minconfirms; } } - printf("after init loop\n"), getchar(); + printf("after init loop\n");//, getchar(); coin = coins[0]; iguana_rwiAddrind(coin,0,0,0); iguana_possible_peer(coin,"127.0.0.1"); memset(zero.bytes,0,sizeof(zero)); if ( (bp= iguana_bundlecreate(coin,&bundlei,0,*(bits256 *)coin->chain->genesis_hashdata,zero,1)) != 0 ) bp->bundleheight = 0; - printf("after bundlecreate\n"), getchar(); + printf("after bundlecreate\n");//, getchar(); while ( 1 ) { //printf("iter\n"); diff --git a/iguana/iguana777.h b/iguana/iguana777.h index dd46a9834..f14bbdf04 100755 --- a/iguana/iguana777.h +++ b/iguana/iguana777.h @@ -33,9 +33,9 @@ typedef int32_t (*blockhashfunc)(uint8_t *blockhashp,uint8_t *serialized,int32_t #define IGUANA_HEIGHT 200 #define IGUANA_MAXPENDHDRS 1 -#define _IGUANA_MAXPENDING 1024 //64 +#define _IGUANA_MAXPENDING 512 //64 #define _IGUANA_MAXBUNDLES 8 -#define IGUANA_BUNDLELOOP 10 +#define IGUANA_BUNDLELOOP 100 #define IGUANA_RPCPORT 7778 #define IGUANA_MAXRAMCHAINSIZE ((uint64_t)1024L * 1024L * 1024L * 16) @@ -388,11 +388,10 @@ struct iguana_peer double recvblocks,recvtotal; int64_t allocated,freed; struct msgcounts msgcounts; - //FILE *fp; int32_t filecount,addrind; struct OS_memspace RAWMEM,TXDATA,HASHMEM; struct iguana_ramchain ramchain; - //struct iguana_kvitem *txids,*pkhashes; struct iguana_fileitem *filehash2; int32_t numfilehash2,maxfilehash2; + struct iguana_bundle *bp; #ifdef IGUANA_PEERALLOC struct OS_memspace *SEROUT[128]; #endif @@ -415,7 +414,7 @@ struct iguana_bundle struct queueitem DL; struct iguana_info *coin; struct iguana_bundle *nextbp; struct iguana_bloom16 bloom; uint32_t rawscriptspace; uint32_t issuetime,hdrtime,emitfinish,mergefinish,purgetime,queued; - int32_t numhashes,numrecv,numsaved,numcached; + int32_t numhashes,numrecv,numsaved,numcached,rank; int32_t minrequests,n,hdrsi,bundleheight,numtxids,numspends,numunspents,numspec; double avetime,threshold,metric; uint64_t datasize,estsize; struct iguana_block *blocks[IGUANA_MAXBUNDLESIZE]; uint32_t issued[IGUANA_MAXBUNDLESIZE]; @@ -452,11 +451,11 @@ struct iguana_info struct tai starttime; double startmillis; struct iguana_chain *chain; struct iguana_iAddr *iAddrs; - struct iguanakv *txids,*spends,*unspents,*pkhashes; - struct iguana_txid *T; - struct iguana_unspent *U; struct iguana_Uextra *Uextras; - struct iguana_spend *S; struct iguana_Sextra *Sextras; - struct iguana_pkhash *P; struct iguana_account *accounts; struct iguana_pkextra *pkextras; + //struct iguanakv *txids,*spends,*unspents,*pkhashes; + //struct iguana_txid *T; + //struct iguana_unspent *U; struct iguana_Uextra *Uextras; + //struct iguana_spend *S; struct iguana_Sextra *Sextras; + //struct iguana_pkhash *P; struct iguana_account *accounts; struct iguana_pkextra *pkextras; //struct iguana_counts latest; //struct iguana_ledger LEDGER,loadedLEDGER; diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index 2e1b1cc87..3367b86c5 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -394,21 +394,44 @@ int64_t iguana_bundlecalcs(struct iguana_info *coin,struct iguana_bundle *bp) bp->numhashes++; } } - bp->metric = bp->numhashes; + //bp->metric = bp->numhashes; + bp->metric = 1000 + sqrt(sqrt(bp->n * (1 + bp->numsaved + bp->numrecv)) * (10 + coin->bundlescount - bp->hdrsi)); return(bp->estsize); } +static int _decreasing_double(const void *a,const void *b) +{ +#define double_a (*(double *)a) +#define double_b (*(double *)b) + if ( double_b > double_a ) + return(1); + else if ( double_b < double_a ) + return(-1); + return(0); +#undef double_a +#undef double_b +} + +static int32_t revsortds(double *buf,uint32_t num,int32_t size) +{ + qsort(buf,num,size,_decreasing_double); + return(0); +} + void iguana_bundlestats(struct iguana_info *coin,char *str) { static uint32_t lastdisp; - int32_t i,n,dispflag,numrecv,done,numhashes,numcached,numsaved,numemit; int64_t estsize = 0; - struct iguana_bundle *bp,*firstgap = 0; + int32_t i,n,m,count,dispflag,numrecv,done,numhashes,numcached,numsaved,numemit; + int64_t estsize = 0; struct iguana_bundle *bp,*firstgap = 0; double *sortbuf; struct iguana_peer *addr; dispflag = (rand() % 1000) == 0; numrecv = numhashes = numcached = numsaved = numemit = done = 0; - for (i=n=0; ibundlescount; i++) + count = coin->bundlescount; + sortbuf = calloc(count,sizeof(*sortbuf)*2); + for (i=n=m=0; ibundles[i]) != 0 ) { + bp->rank = 0; estsize += iguana_bundlecalcs(coin,bp); numhashes += bp->numhashes; numcached += bp->numcached; @@ -420,10 +443,31 @@ void iguana_bundlestats(struct iguana_info *coin,char *str) if ( bp->emitfinish > 1 ) numemit++; iguana_bundlepurge(coin,bp); - } else if ( firstgap == 0 ) - firstgap = bp; + } + else + { + if ( firstgap == 0 ) + firstgap = bp; + sortbuf[m*2] = bp->metric; + sortbuf[m*2 + 1] = i; + m++; + } + } + } + if ( m > 0 ) + { + revsortds(sortbuf,m,sizeof(*sortbuf)*2); + for (i=0; ibundles[(int32_t)sortbuf[i*2 + 1]]) != 0 ) + { + bp->rank = i + 1; + if ( coin->peers.numranked > 0 && i < coin->peers.numranked && (addr= coin->peers.ranked[i]) != 0 ) + addr->bp = bp; + } } } + free(sortbuf); coin->numremain = n; coin->blocksrecv = numrecv; char str2[65]; uint64_t tmp; int32_t diff,p = 0; struct tai difft,t = tai_now(); @@ -435,9 +479,9 @@ void iguana_bundlestats(struct iguana_info *coin,char *str) tmp = (difft.millis * 1000000); tmp %= 1000000000; difft.millis = ((double)tmp / 1000000.); - sprintf(str,"N[%d] Q.%d h.%d r.%d c.%d:%d:%d s.%d d.%d E.%d:%d M.%d L.%d est.%d %s %d:%02d:%02d %03.3f peers.%d/%d Q.(%d %d)",coin->bundlescount,coin->numbundlesQ,numhashes,coin->blocksrecv,coin->numcached,numcached,coin->cachefreed,numsaved,done,numemit,coin->numreqsent,coin->blocks.hwmchain.height,coin->longestchain,coin->MAXBUNDLES,mbstr(str2,estsize),(int32_t)difft.x/3600,(int32_t)(difft.x/60)%60,(int32_t)difft.x%60,difft.millis,p,coin->MAXPEERS,queue_size(&coin->priorityQ),queue_size(&coin->blocksQ)); + sprintf(str,"N[%d] Q.%d h.%d r.%d c.%d:%d:%d s.%d d.%d E.%d:%d M.%d L.%d est.%d %s %d:%02d:%02d %03.3f peers.%d/%d Q.(%d %d)",count,coin->numbundlesQ,numhashes,coin->blocksrecv,coin->numcached,numcached,coin->cachefreed,numsaved,done,numemit,coin->numreqsent,coin->blocks.hwmchain.height,coin->longestchain,coin->MAXBUNDLES,mbstr(str2,estsize),(int32_t)difft.x/3600,(int32_t)(difft.x/60)%60,(int32_t)difft.x%60,difft.millis,p,coin->MAXPEERS,queue_size(&coin->priorityQ),queue_size(&coin->blocksQ)); //sprintf(str+strlen(str),"%s.%-2d %s time %.2f files.%d Q.%d %d\n",coin->symbol,flag,str,(double)(time(NULL)-coin->starttime)/60.,coin->peers.numfiles,queue_size(&coin->priorityQ),queue_size(&coin->blocksQ)); - if ( time(NULL) > lastdisp+1000 ) + if ( time(NULL) > lastdisp+10 ) { printf("%s\n",str); //myallocated(0,0); diff --git a/iguana/iguana_ramchain.c b/iguana/iguana_ramchain.c index 187d080e8..4739fcbd1 100755 --- a/iguana/iguana_ramchain.c +++ b/iguana/iguana_ramchain.c @@ -331,6 +331,7 @@ uint32_t iguana_ramchain_addpkhash(struct iguana_info *coin,RAMCHAIN_FUNC,uint8_ printf("%02x",rmd160[i]); printf(" vs rmd160\n"); printf("iguana_ramchain_addpkhash pkind.%d error mismatched rmd160\n",pkind); + getchar(); return(0); } //ramchain->pkind = (pkind + 1); @@ -832,9 +833,9 @@ uint32_t iguana_ramchain_addspend(struct iguana_info *coin,RAMCHAIN_FUNC,bits256 { if ( (ptr= iguana_hashfind(ramchain,'P',V.signers[i].rmd160)) == 0 ) { - printf("from addspend\n"); - pkind = iguana_ramchain_addpkhash(coin,RAMCHAIN_ARG,V.signers[i].rmd160,0,0,0); - printf("create pkind.%d from vin\n",pkind); + //printf("from addspend\n"); + //pkind = iguana_ramchain_addpkhash(coin,RAMCHAIN_ARG,V.signers[i].rmd160,0,0,0); + //printf("create pkind.%d from vin\n",pkind); } else pkind = ptr->hh.itemind; } } @@ -1301,7 +1302,7 @@ long iguana_ramchain_save(struct iguana_info *coin,RAMCHAIN_FUNC,uint32_t ipbits { destoffset = &Kspace[ramchain->H.scriptoffset]; srcoffset = &Kspace[ramchain->H.data->scriptspace - ramchain->H.stacksize]; - if ( destoffset != srcoffset ) + if ( 0 && destoffset != srcoffset ) { for (i=0; iH.stacksize; i++) c = *srcoffset++, *destoffset++ = c; @@ -1311,7 +1312,7 @@ long iguana_ramchain_save(struct iguana_info *coin,RAMCHAIN_FUNC,uint32_t ipbits iguana_ramchain_lhashes(RAMCHAIN_ARG,rdata,rdata,bp!=0?bp->n:1,ramchain->H.scriptoffset+ramchain->H.stacksize); tmp = *rdata; iguana_ramchain_compact(RAMCHAIN_ARG,&tmp,rdata,bp!=0?bp->n:1); - if ( ramchain->expanded != 0 ) + if ( 0 && ramchain->expanded != 0 ) printf("compact: Koffset.%d scriptoffset.%d stacksize.%d allocsize.%d\n",(int32_t)ramchain->H.data->Koffset,ramchain->H.scriptoffset,ramchain->H.stacksize,(int32_t)ramchain->H.data->allocsize); fwrite(&tmp,1,sizeof(tmp),fp); iguana_ramchain_saveaction(RAMCHAIN_ARG,fp,rdata,bp!=0?bp->n:1,ramchain->H.scriptoffset+ramchain->H.stacksize); @@ -1855,11 +1856,11 @@ int32_t iguana_ramchain_iterate(struct iguana_info *coin,struct iguana_ramchain //printf("from expanded iter\n"); if ( iguana_ramchain_addspend(coin,RAMCHAIN_ARG,prevhash,prevout,sequenceid,bp->hdrsi,scriptdata,scriptlen) == 0 ) { - char str[65]; int32_t i; - printf("txidind.%d spendind.%d spendtxid.%x %d vin.%d %s vout.%d\n",ramchain->H.txidind,ramchain->H.spendind,Sx[ramchain->H.spendind].spendtxidind,Sx[ramchain->H.spendind].spendtxidind&0xfffffff,j,bits256_str(str,prevhash),prevout); - for (i=0; iH.data->numexternaltxids; i++) - printf("%p X[%d] %s\n",X,i,bits256_str(str,X[i])); - exit(-1); + char str[65]; + printf("hdrsi.%d txidind.%d spendind.%d spendtxid.%x %d vin.%d %s vout.%d\n",bp->bundleheight,ramchain->H.txidind,ramchain->H.spendind,Sx[ramchain->H.spendind].spendtxidind,Sx[ramchain->H.spendind].spendtxidind&0xfffffff,j,bits256_str(str,prevhash),prevout); + //for (i=0; iH.data->numexternaltxids; i++) + // printf("%p X[%d] %s\n",X,i,bits256_str(str,X[i])); + //exit(-1); iguana_ramchain_txid(coin,RAMCHAIN_ARG,&prevhash,&Sx[ramchain->H.spendind]); return(-7); } @@ -1989,8 +1990,8 @@ long iguana_ramchain_data(struct iguana_info *coin,struct iguana_peer *addr,stru return(-1); } } - if ( bits256_nonz(bp->hashes[bundlei]) == 0 ) - bp->hashes[bundlei] = origtxdata->block.RO.hash2; + //if ( bits256_nonz(bp->hashes[bundlei]) == 0 ) + // bp->hashes[bundlei] = origtxdata->block.RO.hash2; if ( (block= bp->blocks[bundlei]) == 0 ) { //char str[65]; printf("%d:%d has no block ptr %s\n",bp->hdrsi,bundlei,bits256_str(str,bp->hashes[bundlei])); diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index d4719bcda..7b3d841ae 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -382,7 +382,7 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct iguana_bundle *bp,int } } max = 1 + ((coin->MAXPENDING*coin->MAXPEERS - pend) >> 1); - endmillis = OS_milliseconds() + timelimit; + endmillis = OS_milliseconds() + timelimit*10; while ( bp->emitfinish == 0 && OS_milliseconds() < endmillis ) { now = (uint32_t)time(NULL); @@ -415,7 +415,7 @@ int32_t iguana_bundleiters(struct iguana_info *coin,struct iguana_bundle *bp,int usleep(1000); } width = 1000 + sqrt(sqrt(bp->n * (1+bp->numsaved+issued)) * (10+coin->bundlescount-bp->hdrsi)); - //if ( 0 && counter > 0 ) + if ( 1 && counter > 0 && bp->rank <= coin->peers.numranked ) printf("ITERATE bundle.%d h.%d n.%d r.%d s.%d F.%d I.%d T.%d %f %u next %f\n",bp->bundleheight/coin->chain->bundlesize,bp->numhashes,bp->n,bp->numrecv,bp->numsaved,bp->emitfinish,issued,timelimit,endmillis-OS_milliseconds(),(uint32_t)time(NULL),width); if ( bp->emitfinish == 0 ) { @@ -465,7 +465,7 @@ struct iguana_bundle *iguana_bundleset(struct iguana_info *coin,struct iguana_bl iguana_blockcopy(coin,block,origblock); *blockp = block; prevhash2 = origblock->RO.prev_block; - if ( 1 && bits256_nonz(prevhash2) > 0 ) + if ( 0 && bits256_nonz(prevhash2) > 0 ) iguana_patch(coin,block); if ( (bp= iguana_bundlefind(coin,&bp,&bundlei,hash2)) != 0 && bundlei < coin->chain->bundlesize ) { @@ -873,6 +873,17 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr) flag++; myfree(req,sizeof(*req)); } + else if ( (bp= addr->bp) != 0 && bp->rank != 0 && addr->pendblocks < limit ) + { + for (i=0; in; i++) + if ( (block= bp->blocks[i]) != 0 && block->numrequests == bp->minrequests && block->fpipbits == 0 && block->queued == 0 ) + { + //printf("peer.%s ranked.%d [%d:%d] pending.%d\n",addr->ipaddr,bp->rank,bp->hdrsi,i,addr->pendblocks); + block->numrequests++; + iguana_sendblockreqPT(coin,addr,bp,i,block->RO.hash2,1); + break; + } + } return(flag); } @@ -937,7 +948,7 @@ int32_t iguana_reqblocks(struct iguana_info *coin) lflag++, flag++; else printf("chainlink error for %d\n",coin->blocks.hwmchain.height+1); } - if ( 1 || queue_size(&coin->blocksQ) == 0 ) + if ( queue_size(&coin->blocksQ) < _IGUANA_MAXPENDING ) { double threshold,lag = OS_milliseconds() - coin->backstopmillis; threshold = (10 + coin->longestchain - coin->blocksrecv); @@ -948,7 +959,7 @@ int32_t iguana_reqblocks(struct iguana_info *coin) else threshold = coin->avetime; threshold *= 100. * sqrt(threshold) * .000777; if ( strcmp(coin->symbol,"BTC") != 0 ) - threshold = 300; + threshold = 1000; else threshold = 10000; if ( coin->blocks.hwmchain.height < coin->longestchain && (coin->backstop != coin->blocks.hwmchain.height+1 || lag > threshold) ) { @@ -963,8 +974,9 @@ int32_t iguana_reqblocks(struct iguana_info *coin) coin->backstopmillis = OS_milliseconds(); iguana_blockQ(coin,bp,bundlei,hash2,0); flag++; - //if ( (rand() % 100) == 0 ) - char str[65]; printf("%s MAINCHAIN.%d threshold %.3f %.3f lag %.3f\n",bits256_str(str,hash2),coin->blocks.hwmchain.height+1,threshold,coin->backstopmillis,lag); + char str[65]; + if ( 0 && (rand() % 10) == 0 ) + printf("%s MAINCHAIN.%d threshold %.3f %.3f lag %.3f\n",bits256_str(str,hash2),coin->blocks.hwmchain.height+1,threshold,coin->backstopmillis,lag); } } } diff --git a/iguana/iguana_scripts.c b/iguana/iguana_scripts.c index c5731ccca..214440555 100755 --- a/iguana/iguana_scripts.c +++ b/iguana/iguana_scripts.c @@ -718,9 +718,13 @@ int32_t bitcoin_scriptget(struct iguana_info *coin,int32_t *hashtypep,int32_t *s if ( scriptsig[n] == 0x4c ) vp->p2shlen = scriptsig[n+1], n += 2; else vp->p2shlen = ((uint32_t)scriptsig[n+1] + ((uint32_t)scriptsig[n+2] << 8)), n += 3; - memcpy(vp->p2shscript,&scriptsig[n],vp->p2shlen); - n += vp->p2shlen; - vp->type = IGUANA_SCRIPT_P2SH; + printf("opcode.%02x %02x %02x scriptlen.%d\n",scriptsig[n],scriptsig[n+1],scriptsig[n+2],vp->p2shlen); + if ( vp->p2shlen < IGUANA_MAXSCRIPTSIZE ) + { + memcpy(vp->p2shscript,&scriptsig[n],vp->p2shlen); + n += vp->p2shlen; + vp->type = IGUANA_SCRIPT_P2SH; + } else vp->p2shlen = 0; } if ( n < len ) *suffixp = (len - n); @@ -817,7 +821,7 @@ long iguana_rwscript(struct iguana_info *coin,int32_t rwflag,void *fileptr,long if ( fwrite(script,1,data.scriptlen,fp) != data.scriptlen ) return(-1); offset = (uint32_t)ftell(fp); - printf("spend.%d filesize.%ld wrote.h%d u%d len.%d [%ld,%ld) crc.%08x\n",spendflag,coin->scriptsfilesize[spendflag],hdrsi,ind,data.scriptlen,scriptpos,ftell(fp),calc_crc32(0,script,data.scriptlen)); + //printf("spend.%d filesize.%ld wrote.h%d u%d len.%d [%ld,%ld) crc.%08x\n",spendflag,coin->scriptsfilesize[spendflag],hdrsi,ind,data.scriptlen,scriptpos,ftell(fp),calc_crc32(0,script,data.scriptlen)); } else if ( rwflag == 0 && fp == 0 && fileptr != 0 ) { diff --git a/iguana/main.c b/iguana/main.c index a0af6ab9d..02595181e 100755 --- a/iguana/main.c +++ b/iguana/main.c @@ -1118,10 +1118,10 @@ void iguana_main(void *arg) sleep(1); char *str; //iguana_launchcoin(MYINFO.rpcsymbol,cJSON_Parse("{}")); - if ( 1 && (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":128,\"maxpeers\":64,\"newcoin\":\"BTC\",\"active\":0}"),0)) != 0 ) + if ( 1 && (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":128,\"maxpeers\":128,\"newcoin\":\"BTCD\",\"active\":1}"),0)) != 0 ) { free(str); - if ( 1 && (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":128,\"maxpeers\":128,\"newcoin\":\"BTCD\",\"active\":1}"),0)) != 0 ) + if ( 0 && (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":128,\"maxpeers\":128,\"newcoin\":\"BTCD\",\"active\":1}"),0)) != 0 ) { free(str); if ( 0 && (str= SuperNET_JSON(&MYINFO,cJSON_Parse("{\"agent\":\"SuperNET\",\"method\":\"login\",\"handle\":\"alice\",\"password\":\"alice\",\"passphrase\":\"alice\"}"),0)) != 0 ) @@ -1133,7 +1133,7 @@ void iguana_main(void *arg) } strcpy(MYINFO.rpcsymbol,"BTCD"); printf("BTC active.%d BTCD active.%d\n",iguana_coinfind("BTC")->active,iguana_coinfind("BTCD")->active); - iguana_coinfind("BTC")->active = iguana_coinfind("BTCD")->active = 0; + //iguana_coinfind("BTC")->active = iguana_coinfind("BTCD")->active = 0; } sleep(1); #endif