Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
e8f79463b1
  1. 2
      iguana/iguana777.h
  2. 17
      iguana/iguana_recv.c
  3. 3
      iguana/iguana_unspents.c
  4. 6
      iguana/main.c

2
iguana/iguana777.h

@ -23,7 +23,7 @@
typedef int32_t (*blockhashfunc)(uint8_t *blockhashp,uint8_t *serialized,int32_t len);
#define IGUANA_MAXSCRIPTSIZE 10001
#define IGUANA_SERIALIZE_SPENDVECTORGEN
//#define IGUANA_SERIALIZE_SPENDVECTORGEN
//#define IGUANA_SERIALIZE_BALANCEGEN
//#define IGUANA_DISABLEPEERS
#define _IGUANA_MAXSTUCKTIME 300

17
iguana/iguana_recv.c

@ -820,19 +820,28 @@ struct iguana_bundlereq *iguana_recvblock(struct iguana_info *coin,struct iguana
width = sqrt(coin->chain->bundlesize);
while ( coin->active != 0 && prev != 0 && width-- > 0 )
{
if ( prev->mainchain != 0 )
break;
if ( prev->fpipbits == 0 )
if ( prev->fpipbits == 0 || prev->RO.recvlen == 0 || prev->fpos < 0 || bits256_nonz(prev->RO.prev_block) == 0 )
{
//printf("width.%d auto prev newtx %s\n",width,bits256_str(str,prev->RO.hash2));
prev->newtx = 1;
iguana_blockQ("autoprev",coin,0,-1,prev->RO.hash2,0);
}
tmpblock = prev;
if ( bits256_nonz(prev->RO.prev_block) != 0 )
{
if ( (prev = iguana_blockhashset(coin,-1,prev->RO.prev_block,1)) != 0 )
prev->newtx = 1;
} else prev = 0;
prev->hh.next = tmpblock;
if ( prev->mainchain != 0 )
{
while ( tmpblock != 0 && _iguana_chainlink(coin,tmpblock) != 0 )
{
printf("NEWHWM.%d\n",tmpblock->height);
tmpblock = tmpblock->hh.next;
}
break;
}
} else prev = 0;
}
}
if ( req->copyflag != 0 )

3
iguana/iguana_unspents.c

@ -303,9 +303,10 @@ struct iguana_pkhash *iguana_pkhashfind(struct iguana_info *coin,struct iguana_r
*balancep = ACCTS[pkind].total;
*lastunspentindp = ACCTS[pkind].lastunspentind;
*p = P[pkind];
printf("return pkind.%u %.8f\n",pkind,dstr(*balancep));
return(p);
} //else printf("not found pkind.%d vs num.%d\n",pkind,ramchain->H.data->numpkinds);
} else printf("%s.[%d] error null ramchain->H.data\n",coin->symbol,i);
} else printf("%s.[%d] error null ramchain->H.data isRT.%d\n",coin->symbol,i,bp->isRT);
}
}
return(0);

6
iguana/main.c

@ -355,14 +355,12 @@ void mainloop(struct supernet_info *myinfo)
for (i=0; i<IGUANA_MAXCOINS; i++)
if ( (coin= Coins[i]) != 0 && coin->current != 0 )
{
printf("main active.%d started.%p\n",coin->active,coin->started);
if ( coin->active != 0 && coin->started != 0 )
{
coin->RTramchain_busy = 1;
if ( iguana_realtime_update(coin) > 0 )
{
printf("call RT update\n");
flag++;
}
if ( (ptr= queue_dequeue(&balancesQ,0)) != 0 )
{
flag++;
@ -394,6 +392,8 @@ void mainloop(struct supernet_info *myinfo)
}
}
coin->RTramchain_busy = (coin->RTgenesis == 0 || queue_size(&balancesQ) != 0);
if ( flag != 0 )
printf("call RT update busy.%d\n",coin->RTramchain_busy);
}
}
}

Loading…
Cancel
Save