|
|
@ -1197,7 +1197,7 @@ int32_t iguana_utxoaddr_check(struct supernet_info *myinfo,struct iguana_info *c |
|
|
|
return(0); |
|
|
|
} |
|
|
|
|
|
|
|
int32_t iguana_utxoaddr_validate(struct supernet_info *myinfo,struct iguana_info *coin,int32_t lastheight) |
|
|
|
int32_t iguana_utxoaddr_validate(struct supernet_info *myinfo,struct iguana_info *coin,int32_t lastheight,int32_t count) |
|
|
|
{ |
|
|
|
int64_t *unspents; uint8_t *item; struct iguana_bundle *bp; struct iguana_utxoaddr UA; int32_t i,num,max,ind,total,errs=0; |
|
|
|
if ( coin->utxoaddrtable == 0 ) |
|
|
@ -1216,9 +1216,7 @@ int32_t iguana_utxoaddr_validate(struct supernet_info *myinfo,struct iguana_info |
|
|
|
iguana_volatilesmap(coin,&bp->ramchain); |
|
|
|
} |
|
|
|
total = 0; |
|
|
|
max = 1024 * 1024; |
|
|
|
if ( strcmp("BTC",coin->symbol) == 0 ) |
|
|
|
max *= 1024; |
|
|
|
max = 1024 * 1024 * 1024; |
|
|
|
unspents = calloc(1,max); |
|
|
|
max /= sizeof(*unspents); |
|
|
|
memset(&UA,0,sizeof(UA)); |
|
|
@ -1232,8 +1230,6 @@ int32_t iguana_utxoaddr_validate(struct supernet_info *myinfo,struct iguana_info |
|
|
|
iguana_rwutxoaddr(0,ind,item,&UA); |
|
|
|
errs += iguana_utxoaddr_check(myinfo,coin,lastheight,unspents,max,&UA); |
|
|
|
total++; |
|
|
|
//if ( (total % 1000) == 0 )
|
|
|
|
// fprintf(stderr,".");
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1386,7 +1382,7 @@ continue; |
|
|
|
if ( iguana_utxoaddr_map(coin,fname) != 0 ) |
|
|
|
{ |
|
|
|
printf("validating %s HIST BALANCE %s %.8f errs %d\n",fname2,bits256_str(str,coin->utxoaddrhash),dstr(coin->histbalance),errs); |
|
|
|
errs = iguana_utxoaddr_validate(myinfo,coin,height); |
|
|
|
errs = iguana_utxoaddr_validate(myinfo,coin,height,total); |
|
|
|
printf("gen %s HIST BALANCE %s %.8f errs %d\n",fname2,bits256_str(str,coin->utxoaddrhash),dstr(coin->histbalance),errs); |
|
|
|
if ( errs != 0 || height == 0 ) |
|
|
|
{ |
|
|
|