Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
900efbeacd
  1. 2
      iguana/iguana_realtime.c
  2. 4
      iguana/iguana_recv.c
  3. 5
      iguana/iguana_unspents.c

2
iguana/iguana_realtime.c

@ -277,7 +277,7 @@ int32_t iguana_realtime_update(struct supernet_info *myinfo,struct iguana_info *
if ( coin->RTdatabad == 0 && bp->hdrsi == coin->longestchain/coin->chain->bundlesize && bp->hdrsi >= coin->balanceswritten-2 && ((coin->RTheight < coin->blocks.hwmchain.height-offset && time(NULL) > bp->lastRT) || time(NULL) > bp->lastRT+1) ) //coin->RTheight >= bp->bundleheight && coin->RTheight < bp->bundleheight+bp->n &&
{
if ( coin->RTheight == 0 )
coin->RTheight = bp->bundleheight;
coin->RTheight = (coin->bundlescount - 1) * coin->chain->bundlesize;
if ( (block= bp->blocks[0]) == 0 || block->txvalid == 0 || block->mainchain == 0 )
{
if ( block != 0 )

4
iguana/iguana_recv.c

@ -1651,9 +1651,9 @@ int32_t iguana_processrecv(struct supernet_info *myinfo,struct iguana_info *coin
if ( iguana_balanceflush(myinfo,coin,coin->balanceflush) > 0 )
printf("balanceswritten.%d flushed coin->balanceflush %d vs %d coin->longestchain/coin->chain->bundlesize\n",coin->balanceswritten,coin->balanceflush,coin->longestchain/coin->chain->bundlesize);
//portable_mutex_unlock(&coin->RTmutex);
fprintf(stderr,"%s back balanceflush %d\n",coin->symbol,(coin->balanceswritten - 1) * coin->chain->bundlesize);
fprintf(stderr,"%s back balanceflush\n",coin->symbol);
coin->balanceflush = 0;
iguana_utxoaddr_gen(myinfo,coin,(coin->balanceswritten - 1) * coin->chain->bundlesize);
//iguana_utxoaddr_gen(myinfo,coin,(coin->balanceswritten - 1) * coin->chain->bundlesize);
}
flag += iguana_processrecvQ(coin,&newhwm);
flag += iguana_reqhdrs(coin);

5
iguana/iguana_unspents.c

@ -1157,7 +1157,7 @@ int32_t iguana_utxoaddr_validate(struct supernet_info *myinfo,struct iguana_info
int64_t iguana_utxoaddr_gen(struct supernet_info *myinfo,struct iguana_info *coin,int32_t maxheight)
{
char fname[1024],fname2[1024],coinaddr[64],checkaddr[64]; struct iguana_utxoaddr *utxoaddr,UA,*tmp,*last=0; uint16_t hdrsi; uint8_t *table,item[UTXOADDR_ITEMSIZE]; uint32_t *counts,*offsets,offset,n; int32_t errs,height=0,j,k,ind,tablesize=0; struct iguana_bundle *bp; struct iguana_ramchaindata *rdata=0; int64_t checkbalance=0,balance = 0;
char fname[1024],fname2[1024],coinaddr[64],checkaddr[64]; struct iguana_utxoaddr *utxoaddr,UA,*tmp,*last=0; uint16_t hdrsi; uint8_t *table,item[UTXOADDR_ITEMSIZE]; uint32_t *counts,*offsets,offset,n; int32_t errs=0,height=0,j,k,ind,tablesize=0; struct iguana_bundle *bp; struct iguana_ramchaindata *rdata=0; int64_t checkbalance=0,balance = 0;
for (hdrsi=0; hdrsi<coin->bundlescount-1; hdrsi++)
{
if ( (bp= coin->bundles[hdrsi]) != 0 && bp->bundleheight < maxheight )
@ -1166,7 +1166,8 @@ int64_t iguana_utxoaddr_gen(struct supernet_info *myinfo,struct iguana_info *coi
sprintf(fname2,"%s/%s/utxoaddrs.%d",GLOBAL_DBDIR,coin->symbol,height), OS_portable_path(fname2);
if ( iguana_utxoaddr_map(coin,fname2) != 0 )
{
errs = 0;//iguana_utxoaddr_validate(myinfo,coin,height);
if ( strcmp("BTC",coin->symbol) != 0 )
errs = iguana_utxoaddr_validate(myinfo,coin,height);
printf("HIST BALANCE %.8f errs %d\n",dstr(coin->histbalance),errs);
if ( coin->histbalance > 0 )
return(coin->histbalance);

Loading…
Cancel
Save