From 1221e39ad6ba74152129342dff24c7d68b780dac Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 15 Aug 2016 20:47:36 -0300 Subject: [PATCH] test --- iguana/coins/btcd | 2 +- iguana/iguana777.c | 2 +- iguana/iguana_blocks.c | 6 ++--- iguana/iguana_bundles.c | 13 +++++----- iguana/iguana_init.c | 2 ++ iguana/iguana_ramchain.c | 5 ---- iguana/iguana_realtime.c | 24 +++++++++-------- iguana/iguana_recv.c | 2 +- iguana/iguana_spendvectors.c | 6 +++-- iguana/iguana_tx.c | 2 +- iguana/iguana_volatiles.c | 50 ++++++++++++++++++++++++------------ iguana/main.c | 2 +- includes/iguana_structs.h | 4 +-- 13 files changed, 70 insertions(+), 50 deletions(-) diff --git a/iguana/coins/btcd b/iguana/coins/btcd index 02b88e66a..2e63ffede 100755 --- a/iguana/coins/btcd +++ b/iguana/coins/btcd @@ -1 +1 @@ -curl --url "http://127.0.0.1:7778" --data "{\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTCD\",\"startpend\":64,\"endpend\":64,\"services\":129,\"maxpeers\":64,\"RELAY\":1,\"VALIDATE\":1,\"portp2p\":14631,\"rpc\":14632}" +curl --url "http://127.0.0.1:7778" --data "{\"prefetchlag\":-1,\"poll\":50,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTCD\",\"startpend\":64,\"endpend\":64,\"services\":129,\"maxpeers\":64,\"RELAY\":1,\"VALIDATE\":1,\"portp2p\":14631,\"rpc\":14632}" diff --git a/iguana/iguana777.c b/iguana/iguana777.c index 263e94758..600b87f53 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -768,7 +768,7 @@ void iguana_coinloop(void *arg) } //printf("%s flag.%d isRT.%d polltimeout.%d numranked.%d\n",coin->symbol,flag,coin->isRT,coin->polltimeout,coin->peers->numranked); if ( flag == 0 && coin->isRT == 0 && coin->peers != 0 ) - usleep(coin->polltimeout*10000 + (coin->peers->numranked == 0)*1000000); + usleep(coin->polltimeout*1000 + (coin->peers->numranked == 0)*1000000); else if ( coin->current != 0 && coin->current->hdrsi == coin->longestchain/coin->chain->bundlesize ) usleep(coin->polltimeout*5000 + 90000 + (coin->peers->numranked == 0)*1000000); else usleep(coin->polltimeout*1000); diff --git a/iguana/iguana_blocks.c b/iguana/iguana_blocks.c index b74317308..ef47383a2 100755 --- a/iguana/iguana_blocks.c +++ b/iguana/iguana_blocks.c @@ -556,9 +556,9 @@ struct iguana_block *_iguana_chainlink(struct iguana_info *coin,struct iguana_bl block->PoW = PoW_from_compact(block->RO.bits,coin->chain->unitval) + prevPoW; if ( (next= prev->hh.next) != 0 ) { - //printf("block->PoW %f next %f\n",block->PoW,next->PoW); if ( next->mainchain != 0 && block->PoW < next->PoW ) return(0); + //printf("block->PoW %f next %f\n",block->PoW,next->PoW); hwmchain = next; } height = prev->height + 1; @@ -642,8 +642,8 @@ struct iguana_block *_iguana_chainlink(struct iguana_info *coin,struct iguana_bl { char str[65],str2[65]; printf("ERROR: need to fix up bundle for height.%d (%p %p) (%s %s)\n",block->height,block,bp->blocks[block->height % coin->chain->bundlesize],bits256_str(str,block->RO.hash2),bits256_str(str2,bp->hashes[block->height % coin->chain->bundlesize])); - if ( bp == coin->current && coin->RTheight > 0 ) - coin->RTdatabad = 1; + //if ( bp == coin->current && coin->RTheight > 0 ) + // coin->RTdatabad = 1; //iguana_bundleremove(coin,bp->hdrsi,0); //exit(-1); //getchar(); diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index 22bfaf87b..b6a71ac6c 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -233,7 +233,6 @@ int32_t iguana_bundlehash2add(struct iguana_info *coin,struct iguana_block **blo bp->blocks[bundlei] = 0; //if ( block->mainchain != 0 ) // bp->hashes[bundlei] = block->RO.hash2; - return(-1); } /*if ( (block->hdrsi != bp->hdrsi || block->bundlei != bundlei) && (block->hdrsi != 0 || block->bundlei != 0) ) @@ -651,8 +650,8 @@ int32_t iguana_bundleissuemissing(struct iguana_info *coin,struct iguana_bundle if ( (addr= coin->peers->ranked[rand() % max]) != 0 && addr->usock >= 0 && addr->dead == 0 ) { struct iguana_blockreq *req = 0; - //if ( bp == coin->current ) - // printf("iguana_bundleissuemissing.[%d:%d]\n",bp->hdrsi,i); + if ( 0 && bp == coin->current ) + printf("iguana_bundleissuemissing.[%d:%d]\n",bp->hdrsi,i); if ( priority > 2 || bp->numsaved > bp->n-10 ) iguana_sendblockreqPT(coin,addr,bp,i,hash2,0); else @@ -1373,13 +1372,15 @@ void iguana_bundlestats(struct iguana_info *coin,char *str,int32_t lag) tmp = (difft.millis * 1000000); tmp %= 1000000000; difft.millis = ((double)tmp / 1000000.); - if ( (bp= firstgap) != coin->current && bp != 0 )//&& coin->PREFETCHLAG < 0 ) + if ( (bp= firstgap) != 0 )//&& coin->PREFETCHLAG < 0 ) { - printf("new 1st.%d\n",bp->hdrsi); + if ( bp != coin->current ) + printf("new 1st.%d\n",bp->hdrsi); + //else printf("issue 1st.%d\n",bp->hdrsi); for (i=0; in; i++) if ( GETBIT(bp->haveblock,i) == 0 ) bp->issued[i] = 0; - iguana_bundleissuemissing(coin,bp,3,1.); + iguana_bundleissuemissing(coin,bp,1 + (rand() % 3),1.); } if ( (coin->current= firstgap) == 0 ) { diff --git a/iguana/iguana_init.c b/iguana/iguana_init.c index d005dc0b8..4b7532274 100755 --- a/iguana/iguana_init.c +++ b/iguana/iguana_init.c @@ -440,6 +440,7 @@ void iguana_blockspurge(struct iguana_info *coin) coin->blocks.RO = 0; } coin->blocks.maxbits = */coin->blocks.maxblocks = coin->blocks.initblocks = coin->blocks.hashblocks = coin->blocks.issuedblocks = coin->blocks.recvblocks = coin->blocks.emitblocks = coin->blocks.parsedblocks = coin->blocks.dirty = 0; + printf("clear hwmchain\n"); memset(&coin->blocks.hwmchain,0,sizeof(coin->blocks.hwmchain)); } @@ -506,6 +507,7 @@ struct iguana_info *iguana_coinstart(struct iguana_info *coin,int32_t initialhei //iguana_recvalloc(coin,initialheight); if ( coin->longestchain == 0 ) coin->longestchain = 1; + printf("clear hwmchain\n"); memset(&coin->blocks.hwmchain,0,sizeof(coin->blocks.hwmchain)); coin->blocks.hwmchain.height = 0; coin->blocks.hwmchain.RO.allocsize = coin->chain->zcash != 0 ? sizeof(struct iguana_zblock) : sizeof(struct iguana_block); diff --git a/iguana/iguana_ramchain.c b/iguana/iguana_ramchain.c index 536089ac7..acb71e90d 100755 --- a/iguana/iguana_ramchain.c +++ b/iguana/iguana_ramchain.c @@ -511,11 +511,6 @@ uint32_t iguana_ramchain_addspend(struct iguana_info *coin,RAMCHAIN_FUNC,bits256 } else { - //for (i=0; isequenceid = sequence; s->external = external, s->spendtxidind = txidind, s->prevout = prev_vout; diff --git a/iguana/iguana_realtime.c b/iguana/iguana_realtime.c index 7ee0be051..ccc0cf420 100755 --- a/iguana/iguana_realtime.c +++ b/iguana/iguana_realtime.c @@ -14,10 +14,11 @@ ******************************************************************************/ #include "iguana777.h" +#define ENABLE_RAMCHAIN void iguana_RTramchainfree(struct iguana_info *coin,struct iguana_bundle *bp) { - return; + //return; #ifdef ENABLE_RAMCHAIN int32_t hdrsi; //portable_mutex_lock(&coin->RTmutex); @@ -49,7 +50,7 @@ void iguana_RTramchainfree(struct iguana_info *coin,struct iguana_bundle *bp) void *iguana_ramchainfile(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_ramchain *dest,struct iguana_ramchain *R,struct iguana_bundle *bp,int32_t bundlei,struct iguana_block *block) { - return(0); + //return(0); #ifdef ENABLE_RAMCHAIN char fname[1024]; long filesize; int32_t err; void *ptr=0; if ( block == bp->blocks[bundlei] && (ptr= iguana_bundlefile(coin,fname,&filesize,bp,bundlei)) != 0 ) @@ -69,13 +70,13 @@ void *iguana_ramchainfile(struct supernet_info *myinfo,struct iguana_info *coin, iguana_blockunmark(coin,block,bp,bundlei,1); iguana_ramchain_free(coin,R,1); } //else printf("ramchainfile ptr.%p block.%p\n",ptr,block); - return(0); #endif + return(0); } void iguana_RTramchainalloc(char *fname,struct iguana_info *coin,struct iguana_bundle *bp) { - return; + //return; #ifdef ENABLE_RAMCHAIN uint32_t i,changed = 0; struct iguana_ramchaindata *rdata; struct iguana_ramchain *dest = &coin->RTramchain; struct iguana_blockRO *B; struct iguana_bundle *tmpbp; //portable_mutex_lock(&coin->RTmutex); @@ -126,7 +127,7 @@ void iguana_RTramchainalloc(char *fname,struct iguana_info *coin,struct iguana_b void iguana_rdataset(struct iguana_ramchain *dest,struct iguana_ramchaindata *rdest,struct iguana_ramchain *src) { - return; + //return; #ifdef ENABLE_RAMCHAIN *dest = *src; dest->H.data = rdest; @@ -142,7 +143,7 @@ void iguana_rdataset(struct iguana_ramchain *dest,struct iguana_ramchaindata *rd void iguana_rdatarestore(struct iguana_ramchain *dest,struct iguana_ramchaindata *rdest,struct iguana_ramchain *src) { - return; + //return; #ifdef ENABLE_RAMCHAIN *src = *dest; *src->H.data = *rdest; @@ -157,7 +158,7 @@ void iguana_rdatarestore(struct iguana_ramchain *dest,struct iguana_ramchaindata void iguana_RThdrs(struct iguana_info *coin,struct iguana_bundle *bp,int32_t numaddrs) { - return; + //return; #ifdef ENABLE_RAMCHAIN int32_t datalen,i; uint8_t serialized[512]; char str[65]; struct iguana_peer *addr; if ( coin->peers == 0 ) @@ -179,7 +180,7 @@ void iguana_RThdrs(struct iguana_info *coin,struct iguana_bundle *bp,int32_t num void iguana_RTspendvectors(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_bundle *bp) { - return; + //return; #ifdef ENABLE_RAMCHAIN int32_t iterate,lasti,num,hdrsi,orignumemit; struct iguana_ramchain R; struct iguana_ramchaindata RDATA; if ( bp->hdrsi <= 0 ) @@ -230,10 +231,11 @@ void iguana_RTspendvectors(struct supernet_info *myinfo,struct iguana_info *coin int32_t iguana_realtime_update(struct supernet_info *myinfo,struct iguana_info *coin) { - return(0); + int32_t flag = 0; + //return(0); #ifdef ENABLE_RAMCHAIN double startmillis0; static double totalmillis0; static int32_t num0; - struct iguana_bundle *bp; struct iguana_ramchaindata *rdata; int32_t offset,bundlei,i,n,flag=0; bits256 hash2,*ptr; struct iguana_peer *addr; + struct iguana_bundle *bp; struct iguana_ramchaindata *rdata; int32_t offset,bundlei,i,n; bits256 hash2,*ptr; struct iguana_peer *addr; struct iguana_block *block=0; struct iguana_blockRO *B; struct iguana_ramchain *dest=0,blockR; if ( coin->peers == 0 && coin->virtualchain == 0 ) return(0); @@ -458,6 +460,6 @@ int32_t iguana_realtime_update(struct supernet_info *myinfo,struct iguana_info * printf("DONE DATABAD fixing\n"); //portable_mutex_unlock(&coin->RTmutex); } - return(flag); #endif + return(flag); } diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 8f835e849..52f959d12 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -93,7 +93,7 @@ int32_t iguana_sendblockreqPT(struct iguana_info *coin,struct iguana_peer *addr, } if ( addr->msgcounts.verack == 0 ) { - printf("iguana_sendblockreq (%s) addrind.%d hasn't verack'ed yet\n",addr->ipaddr,addr->addrind); + //printf("iguana_sendblockreq (%s) addrind.%d hasn't verack'ed yet\n",addr->ipaddr,addr->addrind); //iguana_send_version(coin,addr,coin->myservices); return(-1); } diff --git a/iguana/iguana_spendvectors.c b/iguana/iguana_spendvectors.c index e220be245..2cc7abe3c 100755 --- a/iguana/iguana_spendvectors.c +++ b/iguana/iguana_spendvectors.c @@ -713,10 +713,12 @@ int32_t iguana_volatilesinit(struct supernet_info *myinfo,struct iguana_info *co iguana_bundlestats(coin,buf,IGUANA_DEFAULTLAG); if ( (bp= coin->bundles[coin->bundlescount-1]) != 0 && (block= bp->blocks[bp->n-1]) != 0 ) { - //char str[65]; - //printf("set hwmchain.%d <- %s %p\n",bp->bundleheight+bp->n-1,bits256_str(str,bp->hashes[bp->n-1]),block); if ( block->height > coin->blocks.hwmchain.height ) + { + char str[65]; + printf("set hwmchain.%d <- %s %p\n",block->height,bits256_str(str,bp->hashes[bp->n-1]),block); iguana_blockzcopy(coin->chain->zcash,(void *)&coin->blocks.hwmchain,block); + } } //printf("end volatilesinit\n"); if ( iguana_fastfindinit(coin) == 0 )//&& coin->PREFETCHLAG >= 0 ) diff --git a/iguana/iguana_tx.c b/iguana/iguana_tx.c index 02922e47c..8d05767df 100755 --- a/iguana/iguana_tx.c +++ b/iguana/iguana_tx.c @@ -241,7 +241,7 @@ int32_t iguana_peerblockrequest(struct iguana_info *coin,uint8_t *blockspace,int { if ( (rdata= bp->ramchain.H.data) == 0 )//&& bp == coin->current ) { - printf("iguana_peerblockrequest no ramchain data [%d] use RTcache\n",bp->hdrsi); + //printf("iguana_peerblockrequest no ramchain data [%d] use RTcache\n",bp->hdrsi); //rdata = coin->RTramchain.H.data; return(-1); } diff --git a/iguana/iguana_volatiles.c b/iguana/iguana_volatiles.c index 0a7a1c1bd..4d25b7c7e 100755 --- a/iguana/iguana_volatiles.c +++ b/iguana/iguana_volatiles.c @@ -43,6 +43,7 @@ int32_t iguana_utxoupdate(struct iguana_info *coin,int16_t spent_hdrsi,uint32_t hhutxo->u.spentflag = 0; hhutxo->u.fromheight = 0; hhutxo->u.prevunspentind = 0; + free(hhutxo); } } if ( coin->accountstable != 0 ) @@ -51,6 +52,7 @@ int32_t iguana_utxoupdate(struct iguana_info *coin,int16_t spent_hdrsi,uint32_t { hhacct->a.lastunspentind = 0; hhacct->a.total = 0; + free(hhacct); } } return(0); @@ -62,10 +64,18 @@ int32_t iguana_utxoupdate(struct iguana_info *coin,int16_t spent_hdrsi,uint32_t } uval = ((uint64_t)spent_hdrsi << 32) | spent_unspentind; pval = ((uint64_t)spent_hdrsi << 32) | spent_pkind; - if ( (hhutxo= iguana_hhutxofind(coin,uval)) != 0 && hhutxo->u.spentflag != 0 ) + if ( (hhutxo= iguana_hhutxofind(coin,uval)) != 0 ) { - printf("hhutxo.%p spentflag.%d\n",hhutxo,hhutxo->u.spentflag); - return(-1); + if ( hhutxo->u.spentflag != 0 ) + { + printf("hhutxo.%p spentflag.%d\n",hhutxo,hhutxo->u.spentflag); + return(-1); + } + else if ( spendind == hhutxo->u.spendind && fromheight == hhutxo->u.fromheight ) + { + printf("redundant hhutxo ht.%d s%u\n",fromheight,spendind); + return(0); + } } hhutxo = calloc(1,sizeof(*hhutxo)); hhutxo->uval = uval; @@ -76,10 +86,11 @@ int32_t iguana_utxoupdate(struct iguana_info *coin,int16_t spent_hdrsi,uint32_t hhacct->pval = pval; HASH_ADD_KEYPTR(hh,coin->accountstable,&hhacct->pval,sizeof(hhacct->pval),hhacct); } - //printf("create hhutxo.%p hhacct.%p from.%d\n",hhutxo,hhacct,fromheight); + printf("create hhutxo.%p hhacct.%p from.%d\n",hhutxo,hhacct,fromheight); hhutxo->u.spentflag = 1; hhutxo->u.lockedflag = 0; hhutxo->u.fromheight = fromheight; + hhutxo->u.spendind = spendind; hhutxo->u.prevunspentind = hhacct->a.lastunspentind; hhacct->a.lastunspentind = spent_unspentind; hhacct->a.total += spent_value; @@ -95,7 +106,7 @@ int32_t iguana_utxoupdate(struct iguana_info *coin,int16_t spent_hdrsi,uint32_t struct iguana_utxo iguana_utxofind(struct iguana_info *coin,int16_t spent_hdrsi,uint32_t spent_unspentind,int32_t *RTspendflagp,int32_t lockflag) { - uint64_t val,uval; struct iguana_hhutxo *hhutxo; struct iguana_utxo utxo; struct iguana_ramchain *ramchain; struct iguana_bundle *bp; struct iguana_ramchaindata *rdata; int32_t flag; + uint64_t val; struct iguana_hhutxo *hhutxo; struct iguana_utxo utxo; struct iguana_ramchain *ramchain; struct iguana_bundle *bp; struct iguana_ramchaindata *rdata; *RTspendflagp = 0; memset(&utxo,0,sizeof(utxo)); if ( coin->disableUTXO != 0 ) @@ -108,9 +119,9 @@ struct iguana_utxo iguana_utxofind(struct iguana_info *coin,int16_t spent_hdrsi, ramchain = &bp->ramchain;//(bp == coin->current) ? &coin->RTramchain : &bp->ramchain; if ( (rdata= ramchain->H.data) == 0 ) return(utxo); - flag = (coin->RTheight > 0); - if ( flag != 0 ) - portable_mutex_lock(&coin->RTmutex); + //flag = (coin->RTheight > 0); + //if ( flag != 0 ) + // portable_mutex_lock(&coin->RTmutex); val = ((uint64_t)spent_hdrsi << 32) | spent_unspentind; if ( spent_unspentind > 0 && spent_unspentind < rdata->numunspents ) { @@ -121,17 +132,17 @@ struct iguana_utxo iguana_utxofind(struct iguana_info *coin,int16_t spent_hdrsi, { if ( (hhutxo= iguana_hhutxofind(coin,val)) == 0 ) { - uval = ((uint64_t)spent_hdrsi << 32) | spent_unspentind; + /*uval = ((uint64_t)spent_hdrsi << 32) | spent_unspentind; if ( (hhutxo= iguana_hhutxofind(coin,uval)) != 0 && hhutxo->u.spentflag != 0 ) { printf("iguana_hhutxofind warning: hhutxo.%p spentflag.%d\n",hhutxo,hhutxo->u.spentflag); memset(&utxo,0,sizeof(utxo)); - if ( flag != 0 ) - portable_mutex_unlock(&coin->RTmutex); + //if ( flag != 0 ) + // portable_mutex_unlock(&coin->RTmutex); return(utxo); - } + }*/ hhutxo = calloc(1,sizeof(*hhutxo)); - hhutxo->uval = uval; + hhutxo->uval = val; HASH_ADD_KEYPTR(hh,coin->utxotable,&hhutxo->uval,sizeof(hhutxo->uval),hhutxo); } } @@ -157,8 +168,8 @@ struct iguana_utxo iguana_utxofind(struct iguana_info *coin,int16_t spent_hdrsi, { printf("illegal unspentind.%u vs %u hdrs.%d\n",spent_unspentind,rdata->numunspents,spent_hdrsi); } - if ( flag != 0 ) - portable_mutex_unlock(&coin->RTmutex); + //if ( flag != 0 ) + // portable_mutex_unlock(&coin->RTmutex); return(utxo); } @@ -220,6 +231,7 @@ int32_t iguana_volatileupdate(struct iguana_info *coin,int32_t incremental,struc if ( 0 && fromheight/coin->chain->bundlesize >= coin->current->hdrsi ) printf("iguana_volatileupdate.%d: [%d] spent.(u%u %.8f pkind.%d) fromht.%d [%d] spendind.%d\n",incremental,spent_hdrsi,spent_unspentind,dstr(spent_value),spent_pkind,fromheight,fromheight/coin->chain->bundlesize,spendind); utxo->prevunspentind = A2[spent_pkind].lastunspentind; + utxo->spendind = spendind; utxo->spentflag = 1; utxo->fromheight = fromheight; A2[spent_pkind].total += spent_value; @@ -229,7 +241,13 @@ int32_t iguana_volatileupdate(struct iguana_info *coin,int32_t incremental,struc } else { - printf("from.%d spent_unspentind[%d] in hdrs.[%d] is spent fromht.%d %.8f\n",fromheight,spent_unspentind,spent_hdrsi,utxo->fromheight,dstr(spent_value)); + if ( spendind != utxo->spendind || fromheight != utxo->fromheight ) + printf("from.%d spent_unspentind[%d] in hdrs.[%d] is spent fromht.%d %.8f\n",fromheight,spent_unspentind,spent_hdrsi,utxo->fromheight,dstr(spent_value)); + else + { + portable_mutex_unlock(&coin->RTmutex); + return(0); + } } } else printf("null ptrs.[%d] u.%u p.%u %.8f from ht.%d s.%u\n",spent_hdrsi,spent_unspentind,spent_pkind,dstr(spent_value),fromheight,spendind); } diff --git a/iguana/main.c b/iguana/main.c index ed933596f..97ac43f1e 100755 --- a/iguana/main.c +++ b/iguana/main.c @@ -551,7 +551,7 @@ void iguana_appletests(struct supernet_info *myinfo) bitcoin_sharedsecret(myinfo->ctx,hash2,pubkey,33); printf("secp256k1 elapsed %.3f for %d iterations\n",OS_milliseconds() - startmillis,i); getchar();**/ - if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"protover\":70002,\"RELAY\":1,\"VALIDATE\":0,\"portp2p\":14631,\"rpc\":14632,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":2,\"endpend\":2,\"services\":129,\"maxpeers\":64,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":1,\"poll\":100}"),0,myinfo->rpcport)) != 0 ) + if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"protover\":70002,\"RELAY\":1,\"VALIDATE\":0,\"portp2p\":14631,\"rpc\":14632,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":2,\"endpend\":2,\"services\":129,\"maxpeers\":64,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":1,\"poll\":1}"),0,myinfo->rpcport)) != 0 ) { free(str); if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"portp2p\":8333,\"RELAY\":0,\"VALIDATE\":0,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":1,\"endpend\":1,\"services\":128,\"maxpeers\":8,\"newcoin\":\"BTC\",\"active\":0,\"numhelpers\":1,\"poll\":100}"),0,myinfo->rpcport)) != 0 ) diff --git a/includes/iguana_structs.h b/includes/iguana_structs.h index 5798eb7c6..a8c097669 100755 --- a/includes/iguana_structs.h +++ b/includes/iguana_structs.h @@ -249,7 +249,7 @@ struct iguana_pkhash { uint8_t rmd160[20]; uint32_t pkind; } __attribute__((pack // dynamic struct iguana_account { int64_t total; uint32_t lastunspentind; } __attribute__((packed)); -struct iguana_utxo { uint32_t fromheight:31,lockedflag:1,prevunspentind:31,spentflag:1; } __attribute__((packed)); +struct iguana_utxo { uint32_t fromheight:31,lockedflag:1,prevunspentind:31,spentflag:1,spendind; } __attribute__((packed)); struct iguana_hhaccount { UT_hash_handle hh; uint64_t pval; struct iguana_account a; } __attribute__((packed)); struct iguana_hhutxo { UT_hash_handle hh; uint64_t uval; struct iguana_utxo u; } __attribute__((packed)); @@ -406,7 +406,7 @@ struct iguana_info portable_mutex_t peers_mutex,blocks_mutex,special_mutex,RTmutex; char changeaddr[64]; struct iguana_bundle *bundles[IGUANA_MAXBUNDLES],*current,*lastpending; - //struct iguana_ramchain RTramchain; struct OS_memspace RTmem,RThashmem; + struct iguana_ramchain RTramchain; struct OS_memspace RTmem,RThashmem; bits256 RThash1; int32_t numremain,numpendings,zcount,recvcount,bcount,pcount,lastbundle,numsaved,pendbalances,numverified,blockdepth; uint32_t recvtime,hdrstime,backstoptime,lastbundletime,numreqsent,numbundlesQ,lastbundleitime,lastdisp,RTgenesis,firstRTgenesis,RTstarti,idletime,stucktime,stuckmonitor,maxstuck,lastreqtime,RThdrstime,nextchecked,lastcheckpoint;