Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
9ad9b03a8a
  1. 2
      iguana/iguana777.h
  2. 3
      iguana/iguana_ramchain.c
  3. 14
      iguana/iguana_recv.c
  4. 13
      iguana/iguana_unspents.c

2
iguana/iguana777.h

@ -469,7 +469,7 @@ struct iguana_info
uint64_t instance_nonce,myservices,totalsize,totalrecv,totalpackets,sleeptime;
int64_t mining,totalfees,TMPallocated,MAXRECVCACHE,MAXMEM,PREFETCHLAG,estsize,activebundles;
int32_t MAXPEERS,MAXPENDINGREQUESTS,MAXBUNDLES,MAXSTUCKTIME,active,closestbundle,numemitted,lastsweep,startutc,newramchain,numcached,cachefreed,helperdepth,startPEND,endPEND,enableCACHE,RELAYNODE,VALIDATENODE,origbalanceswritten,balanceswritten,RTheight; bits256 balancehash;
uint32_t lastsync,parsetime,numiAddrs,lastpossible,bundlescount,savedblocks,backlog,spendvectorsaved; char VALIDATEDIR[512];
uint32_t lastsync,parsetime,numiAddrs,lastpossible,bundlescount,savedblocks,backlog,spendvectorsaved,laststats; char VALIDATEDIR[512];
int32_t longestchain,badlongestchain,longestchain_strange,RTramchain_busy,emitbusy,stuckiters;
struct tai starttime; double startmillis;
struct iguana_chain *chain;

3
iguana/iguana_ramchain.c

@ -1912,7 +1912,8 @@ void iguana_ramchain_disp(struct iguana_ramchain *ramchain)
void iguana_blockunmark(struct iguana_info *coin,struct iguana_block *block,struct iguana_bundle *bp,int32_t i,int32_t deletefile)
{
void *ptr; int32_t recvlen,hdrsi,checki; char fname[1024]; static const bits256 zero;
printf("UNMARK.[%d:%d]\n",block->hdrsi,i);
if ( bp != 0 )
printf("UNMARK.[%d:%d]\n",bp->hdrsi,i);
block->queued = 0;
block->fpipbits = 0;
block->fpos = -1;

14
iguana/iguana_recv.c

@ -931,7 +931,7 @@ struct iguana_bundlereq *iguana_recvblock(struct iguana_info *coin,struct iguana
}
}
}
if ( 0 )//&& bp != 0 && bp->hdrsi == coin->bundlescount-1 )
if ( 1 )//&& bp != 0 && bp->hdrsi == coin->bundlescount-1 )
{
int32_t i; static int32_t numrecv;
numrecv++;
@ -1429,10 +1429,14 @@ int32_t iguana_processrecv(struct iguana_info *coin) // single threaded
flag += iguana_processrecvQ(coin,&newhwm);
flag += iguana_reqblocks(coin);
flag += iguana_reqhdrs(coin);
coin->RTramchain_busy = 1;
flag += (iguana_realtime_update(coin) > 0);
coin->RTramchain_busy = (coin->RTgenesis == 0 || queue_size(&balancesQ) != 0);
iguana_bundlestats(coin,str,IGUANA_DEFAULTLAG);
if ( time(NULL) > coin->laststats )
{
coin->RTramchain_busy = 1;
flag += (iguana_realtime_update(coin) > 0);
coin->RTramchain_busy = (coin->RTgenesis == 0 || queue_size(&balancesQ) != 0);
iguana_bundlestats(coin,str,IGUANA_DEFAULTLAG);
coin->laststats = (uint32_t)time(NULL);
}
iguana_jsonQ();
if ( hwmheight != coin->blocks.hwmchain.height )
flag = 1;

13
iguana/iguana_unspents.c

@ -1372,9 +1372,9 @@ void *iguana_ramchainfile(struct iguana_info *coin,struct iguana_ramchain *dest,
printf("ERROR [%d:%d] %s vs ",bp->hdrsi,bundlei,bits256_str(str,block->RO.hash2));
printf("mapped.%s\n",bits256_str(str,R->H.data->firsthash2));
} else return(ptr);
iguana_ramchain_free(coin,R,1);
iguana_blockunmark(coin,block,bp,bundlei,0);
iguana_blockunmark(coin,block,bp,bundlei,1);
}
iguana_ramchain_free(coin,R,1);
}
return(0);
}
@ -1402,6 +1402,8 @@ int32_t iguana_realtime_update(struct iguana_info *coin)
if ( iguana_ramchainfile(coin,dest,&blockR,bp,bundlei,block) == 0 )
{
//iguana_RTramchainfree(coin);
char str[65]; printf("RT error [%d:%d] %s %p\n",bp->hdrsi,bundlei,bits256_str(str,bp->hashes[bundlei]),block);
iguana_blockQ("RT",coin,bp,bundlei,bp->hashes[bundlei],1);
return(-1);
} else iguana_ramchain_free(coin,&blockR,1);
B[bundlei] = block->RO;
@ -1737,7 +1739,12 @@ int32_t iguana_balancecalc(struct iguana_info *coin,struct iguana_bundle *bp,int
{
if ( coin->origbalanceswritten <= 1 && coin->spendvectorsaved == 0 )
{
if ( bp->tmpspends != 0 && bp->ramchain.H.data != 0 && (n= bp->ramchain.H.data->numspends) != 0 && bp->converted == 0 )
for (i=0; i<coin->bundlescount-1; i++)
{
if ( coin->bundles[i] == 0 || coin->bundles[i]->tmpspends == 0 )
break;
}
if ( i == coin->bundlescount-1 && bp->tmpspends != 0 && bp->ramchain.H.data != 0 && (n= bp->ramchain.H.data->numspends) != 0 && bp->converted == 0 )
{
if ( (converted= iguana_spendvectorconvs(coin,bp)) < 0 )
printf("error ram balancecalc.[%d]\n",bp->hdrsi);

Loading…
Cancel
Save