Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
63081f76f8
  1. 18
      iguana/iguana_bundles.c
  2. 4
      iguana/iguana_recv.c
  3. 4
      iguana/iguana_unspents.c
  4. 2
      iguana/main.c

18
iguana/iguana_bundles.c

@ -875,7 +875,7 @@ int32_t iguana_cacheprocess(struct iguana_info *coin,struct iguana_bundle *bp,in
double iguana_bundlemissings(struct iguana_info *coin,struct iguana_bundle *bp,double aveduration,int32_t lag)
{
uint8_t missings[IGUANA_MAXBUNDLESIZE/8+1]; int32_t i,tmp,dist=0,missing,priority,avail,n=0,max; double aveduplicates;
uint8_t missings[IGUANA_MAXBUNDLESIZE/8+1]; int32_t i,tmp,dist=0,missing,priority,avail,n=0,max; double aveduplicates; bits256 hash2;
missing = iguana_blocksmissing(coin,&avail,missings,0,bp,0,lag);
priority = (strcmp("BTC",coin->symbol) != 0) * 2;
lag = IGUANA_DEFAULTLAG;
@ -891,9 +891,21 @@ double iguana_bundlemissings(struct iguana_info *coin,struct iguana_bundle *bp,d
}
if ( queue_size(&coin->priorityQ) < (3 * bp->n)/(dist+1) )
{
printf("[%d] dist.%d numcached.%d priority.%d\n",bp->hdrsi,dist,bp->numcached,priority);
for (i=0; i<bp->n; i++)
if ( GETBIT(missings,i) != 0 && bits256_nonz(bp->hashes[i]) != 0 )
iguana_blockQ("missings",coin,bp,i,bp->hashes[i],1);
{
if ( bits256_nonz(bp->hashes[i]) != 0 )
hash2 = bp->hashes[i];
else if ( bits256_nonz(bp->hashes[i]) != 0 && bp->speculative != 0 )
hash2 = bp->speculative[i];
else continue;
if ( GETBIT(missings,i) != 0 && bits256_nonz(hash2) != 0 )
{
if ( bp == coin->current )
printf("issue.[%d:%d]\n",bp->hdrsi,i);
iguana_blockQ("missings",coin,bp,i,hash2,1);
}
}
}
}
if ( bp->durationscount != 0 )

4
iguana/iguana_recv.c

@ -949,9 +949,9 @@ struct iguana_bundlereq *iguana_recvblock(struct iguana_info *coin,struct iguana
}
fprintf(stderr,"%s [%d:%d] block.%x | s.%d r.%d copy.%d\n",bits256_str(str,origblock->RO.hash2),bp!=0?bp->hdrsi:-1,bundlei,block->fpipbits,numsaved,numrecv,req->copyflag);
}
if ( 1 && bundlei == 1 && bp != 0 && bp->numhashes < bp->n && coin->enableCACHE != 0 && bp->speculative == 0 )
if ( 1 && bundlei == 1 && bp != 0 && bp->numhashes < bp->n && coin->enableCACHE != 0 && bp->speculative == 0 && bp == coin->current )
{
//printf("reissue hdrs request for [%d]\n",bp->hdrsi);
printf("reissue hdrs request for [%d]\n",bp->hdrsi);
queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(bits256_str(str,bp->hashes[0])),1);
}
if ( (block= iguana_blockhashset(coin,-1,origblock->RO.hash2,1)) != 0 )

4
iguana/iguana_unspents.c

@ -752,12 +752,12 @@ int32_t iguana_spendvectors(struct iguana_info *coin,struct iguana_bundle *bp)
printf("unexpected spendbp: height.%d bp.[%d] U%d <- S%d.[%d] [ext.%d %s prev.%d]\n",bp->bundleheight+i,spentbp->hdrsi,spent_unspentind,spendind,bp->hdrsi,s->external,bits256_str(str,prevhash),s->prevout);
errs++;
}
if ( coin->PREFETCHLAG != 0 && now >= spentbp->lastprefetch+coin->PREFETCHLAG )
/*if ( coin->PREFETCHLAG != 0 && now >= spentbp->lastprefetch+coin->PREFETCHLAG )
{
printf("prefetch[%d] from.[%d] lag.%d\n",spentbp->hdrsi,bp->hdrsi,now - spentbp->lastprefetch);
iguana_ramchain_prefetch(coin,&spentbp->ramchain);
spentbp->lastprefetch = now;
}
}*/
spentU = (void *)(long)((long)spentbp->ramchain.H.data + spentbp->ramchain.H.data->Uoffset);
u = &spentU[spent_unspentind];
if ( (spent_pkind= u->pkind) != 0 && spent_pkind < spentbp->ramchain.H.data->numpkinds )

2
iguana/main.c

@ -1191,7 +1191,7 @@ void iguana_main(void *arg)
if ( 1 )
{
sleep(1);
if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"startpend\":64,\"endpend\":64,\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":128,\"maxpeers\":512,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":8,\"poll\":1}"),0,myinfo->rpcport)) != 0 )
if ( 1 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"startpend\":512,\"endpend\":512,\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":128,\"maxpeers\":512,\"newcoin\":\"BTCD\",\"active\":1,\"numhelpers\":8,\"poll\":1}"),0,myinfo->rpcport)) != 0 )
{
free(str);
if ( 0 && (str= SuperNET_JSON(myinfo,cJSON_Parse("{\"userhome\":\"/Users/jimbolaptop/Library/Application Support\",\"agent\":\"iguana\",\"method\":\"addcoin\",\"services\":1024,\"maxpeers\":256,\"newcoin\":\"BTCD\",\"active\":1}"),0,myinfo->rpcport)) != 0 )

Loading…
Cancel
Save