Skip to content

Commit

Permalink
Merge pull request jl777#879 from jl777/jl777
Browse files Browse the repository at this point in the history
Improve bob behavior in native
  • Loading branch information
jl777 authored May 31, 2018
2 parents d75b94e + d8a34b7 commit 18afe08
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion iguana/exchanges/LP_nativeDEX.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ void LP_coinsloop(void *_coins)
{
if ( LP_blockinit(coin,coin->lastscanht) < 0 )
{
printf("pleae ignore this blockinit.%s %d error\n",coin->symbol,coin->lastscanht);
printf("please ignore this blockinit.%s %d error\n",coin->symbol,coin->lastscanht);
sleep(10);
break;
}
Expand Down
19 changes: 11 additions & 8 deletions iguana/exchanges/LP_privkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,14 +531,17 @@ void verusblocks(struct iguana_info *coin,char *coinaddr)
}
if ( num > 0 )
{
for (i=0; i<sizeof(histo)/sizeof(*histo); i++)
if ( histo[i] != 0 )
printf("%d %.8f, ",i*1000,histo[i]);
printf("timelocked\n");
for (i=0; i<sizeof(myhisto)/sizeof(*myhisto); i++)
if ( myhisto[i] != 0 )
printf("%d %.8f, ",i*1000,myhisto[i]);
printf("mytimelocked\n");
if ( 0 )
{
for (i=0; i<sizeof(histo)/sizeof(*histo); i++)
if ( histo[i] != 0 )
printf("%d %.8f, ",i*1000,histo[i]);
printf("timelocked\n");
for (i=0; i<sizeof(myhisto)/sizeof(*myhisto); i++)
if ( myhisto[i] != 0 )
printf("%d %.8f, ",i*1000,myhisto[i]);
printf("mytimelocked\n");
}
printf("num.%d PoW %.2f%% %.8f %d v %d PoS %.2f%% %.8f -> %.8f supply %.8f PoW %.1f%% PoS %.1f%% both %.1f%% RTu3sum %.8f %.1f%%\n",num,100.*(double)numpow/num,powsum,npow,npos,100.*(double)numpos/num,possum,powsum+possum,supply,100.*powsum/supply,100.*possum/supply,100.*(powsum+possum)/supply,RTu3sum,100.*RTu3sum/supply);
}
}
Expand Down
7 changes: 4 additions & 3 deletions iguana/exchanges/LP_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int32_t LP_blockinit(struct iguana_info *coin,int32_t height)
{
int32_t i,iter,numtx,checkht=-1; cJSON *blockobj,*txs,*txobj; bits256 txid; struct LP_transaction *tx;
portable_mutex_lock(&LP_blockinit_mutex);
if ( (blockobj= LP_blockjson(&checkht,coin->symbol,0,height)) != 0 && checkht == height )
if ( (blockobj= LP_blockjson(&checkht,coin->symbol,0,height)) != 0 && (checkht == 0 || checkht == height) )
{
if ( (txs= jarray(&numtx,blockobj,"tx")) != 0 )
{
Expand Down Expand Up @@ -54,9 +54,10 @@ int32_t LP_blockinit(struct iguana_info *coin,int32_t height)
free_json(blockobj);
}
portable_mutex_unlock(&LP_blockinit_mutex);
if ( checkht == height )
if ( checkht == 0 || checkht == height )
return(0);
else return(-1);
printf("%s blockinit error checkht.%d vs height.%d\n",ASSETCHAINS_SYMBOL,checkht,height);
return(-1);
}

int32_t LP_scanblockchain(struct iguana_info *coin,int32_t startheight,int32_t endheight)
Expand Down
Loading

0 comments on commit 18afe08

Please sign in to comment.