Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
701dd33003
  1. 5
      gecko/gecko_blocks.c
  2. 3
      iguana/iguana_ramchain.c
  3. 1
      iguana/iguana_realtime.c

5
gecko/gecko_blocks.c

@ -142,6 +142,7 @@ int32_t gecko_hwmset(struct supernet_info *myinfo,struct iguana_info *virt,struc
iguana_blockzcopy(virt->chain->zcash,(void *)&virt->blocks.hwmchain,block);
hdrsi = block->height / virt->chain->bundlesize;
block->hdrsi = hdrsi;
block->height =
block->bundlei = (block->height % virt->chain->bundlesize);
if ( (bp= virt->bundles[hdrsi]) != 0 )
{
@ -212,7 +213,10 @@ char *gecko_blockarrived(struct supernet_info *myinfo,struct iguana_info *virt,c
if ( (prev= iguana_blockfind("geckoprev",virt,prev->RO.prev_block)) == 0 )
return(clonestr("{\"error\":\"gecko block is orphan\"}"));
if ( i == 0 )
{
adjacent = prev->height;
block->height = (prev->height + 1);
}
printf("i.%d prevht.%d adjacent.%d hwm.%d\n",i,prev->height,adjacent,virt->blocks.hwmchain.height);
if ( prev->height >= 0 && prev->mainchain != 0 )
{
@ -259,6 +263,7 @@ char *gecko_blockarrived(struct supernet_info *myinfo,struct iguana_info *virt,c
txdata.zblock.mainchain = block->mainchain = 1;
if ( gecko_hwmset(myinfo,virt,&txdata,virt->TXMEM.ptr,data,datalen,i+1,verifyonly) >= 0 )
{
block->txvalid = block->valid = 1;
if ( block->height > virt->longestchain )
virt->longestchain = block->height;
virt->backstoptime = (uint32_t)time(NULL);

3
iguana/iguana_ramchain.c

@ -81,7 +81,8 @@ struct iguana_kvitem *iguana_hashsetPT(struct iguana_ramchain *ramchain,int32_t
void iguana_blocksetcounters(struct iguana_info *coin,struct iguana_block *block,struct iguana_ramchain * ramchain)
{
printf("iguana_blocksetcounters set 1st txidind.%u <- ht.%d\n",ramchain->H.txidind,block->height);
if ( coin->virtualchain != 0 )
printf("iguana_blocksetcounters.%s 1st txidind.%u <- ht.%d\n",coin->symbol,ramchain->H.txidind,block->height);
block->RO.firsttxidind = ramchain->H.txidind;
block->RO.firstvout = ramchain->H.unspentind;
block->RO.firstvin = ramchain->H.spendind;

1
iguana/iguana_realtime.c

@ -307,6 +307,7 @@ int32_t iguana_realtime_update(struct supernet_info *myinfo,struct iguana_info *
//printf("RT.%d vs hwm.%d starti.%d bp->n %d block.%p/%p ramchain.%p databad.%d prevnonz.%d\n",coin->RTheight,coin->blocks.hwmchain.height,coin->RTstarti,bp->n,block,bp->blocks[bundlei],dest->H.data,coin->RTdatabad,bits256_nonz(block->RO.prev_block));
if ( coin->RTdatabad == 0 && block != 0 && (block->height == 0 || bits256_nonz(block->RO.prev_block) != 0) )
{
printf("bundlei.%d blockht.%d RTheight.%d\n",bundlei,block->height,coin->RTheight);
iguana_blocksetcounters(coin,block,dest);
startmillis0 = OS_milliseconds();
if ( coin->RTdatabad == 0 && iguana_ramchainfile(myinfo,coin,dest,&blockR,bp,bundlei,block) == 0 )

Loading…
Cancel
Save