Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
61e9522141
  1. 7
      iguana/iguana777.c
  2. 12
      iguana/iguana_init.c
  3. 5
      iguana/iguana_unspents.c

7
iguana/iguana777.c

@ -396,15 +396,14 @@ void iguana_helper(void *arg)
{
idle = 0;
coin = ptr->coin;
if ( (bp= ptr->bp) != 0 && coin != 0 && coin->active != 0 )
if ( (bp= ptr->bp) != 0 && coin != 0 )
{
coin->numbundlesQ--;
if ( coin->started != 0 )//&& time(NULL) >= bp->nexttime )
if ( coin->started != 0 && time(NULL) >= bp->nexttime && coin->active != 0 )
flag += iguana_bundleiters(ptr->coin,&MEM,MEMB,bp,ptr->timelimit);
else
{
if ( 0 && bp != 0 )
printf("skip.%d lag.%ld\n",bp->hdrsi,time(NULL)-bp->nexttime);
printf("skip.%d lag.%ld\n",bp->hdrsi,time(NULL)-bp->nexttime);
iguana_bundleQ(ptr->coin,bp,1000);
}
if ( coin->current != 0 && coin->current->hdrsi != coin->bundlescount-1 )

12
iguana/iguana_init.c

@ -352,7 +352,7 @@ void iguana_blockpurge(struct iguana_info *coin,struct iguana_block *block)
void iguana_blockspurge(struct iguana_info *coin)
{
struct iguana_block *block,*tmp;
if ( coin->blocks.hash != 0 )
if ( 0 && coin->blocks.hash != 0 )
{
HASH_ITER(hh,coin->blocks.hash,block,tmp)
{
@ -375,6 +375,11 @@ void iguana_coinpurge(struct iguana_info *coin)
int32_t i,saved; struct iguana_bundle *bp; char *hashstr; struct iguana_bundlereq *req; struct iguana_blockreq *breq; struct iguana_helper *ptr;
saved = coin->active, coin->active = 0;
coin->started = 0;
while ( coin->idletime == 0 && coin->emitbusy > 0 )
{
printf("coinpurge.%s waiting for idle %lu emitbusy.%d\n",coin->symbol,time(NULL),coin->emitbusy);
sleep(1);
}
coin->RTgenesis = 0;
while ( (ptr= queue_dequeue(&bundlesQ,0)) != 0 )
myfree(ptr,ptr->allocsize);
@ -397,11 +402,6 @@ void iguana_coinpurge(struct iguana_info *coin)
myfree(req,req->allocsize);
}
}
while ( coin->idletime == 0 && coin->emitbusy > 0 )
{
printf("coinpurge.%s waiting for idle %lu emitbusy.%d\n",coin->symbol,time(NULL),coin->emitbusy);
sleep(1);
}
iguana_RTramchainfree(coin);
coin->bundlescount = 0;
for (i=0; i<coin->bundlescount; i++)

5
iguana/iguana_unspents.c

@ -437,7 +437,10 @@ struct iguana_bundle *iguana_externalspent(struct iguana_info *coin,bits256 *pre
//else if ( spentbp->ramchain.spents[unspentind].ind != 0 || hdrsi < 0 )
// printf("DOUBLE SPEND? U%d %p bp.[%d] unspentind.%u already has %u, no room\n",unspentind,&spentbp->ramchain.spents[unspentind],hdrsi,unspentind,spentbp->ramchain.spents[unspentind].ind);//, getchar();
else if ( unspentind == 0 || unspentind >= spentbp->ramchain.H.data->numunspents )
printf("illegal unspentind.%d vs max.%d spentbp.%p[%d]\n",unspentind,spentbp->ramchain.H.data->numunspents,spentbp,hdrsi);//, getchar();
{
printf("illegal unspentind.%d vs max.%d spentbp.%p[%d]\n",unspentind,spentbp->ramchain.H.data->numunspents,spentbp,hdrsi);
exit(-1);
}
else return(spentbp);
return(0);
}

Loading…
Cancel
Save