Test
This commit is contained in:
@@ -599,7 +599,9 @@ CBlockIndex *komodo_chainactive(int32_t height)
|
||||
if ( chainActive.Tip() != 0 && height <= chainActive.Tip()->nHeight )
|
||||
{
|
||||
return(chainActive[height]);
|
||||
} else return(0);
|
||||
}
|
||||
fprintf(stderr,"komodo_chainactive height %d > %d active.%d\n",height,chainActive.Tip()->nHeight);
|
||||
return(0);
|
||||
}
|
||||
|
||||
uint32_t komodo_heightstamp(int32_t height)
|
||||
@@ -607,9 +609,13 @@ uint32_t komodo_heightstamp(int32_t height)
|
||||
CBlock block; CBlockIndex *ptr;
|
||||
if ( height > 0 && (ptr= komodo_chainactive(height)) != 0 )
|
||||
{
|
||||
if ( komodo_blockload(block,ptr) == 0 && komodo_block2height(&block) == height )
|
||||
return(block.nTime);
|
||||
}
|
||||
if ( komodo_blockload(block,ptr) == 0 )
|
||||
{
|
||||
if ( komodo_block2height(&block) == height )
|
||||
return(block.nTime);
|
||||
else fprintf(stderr,"komodo_heightstamp block2height %d != %d\n",komodo_block2height(&block),height);
|
||||
} else fprintf(stderr,"komodo_heightstamp cant load block.%d\n",height);
|
||||
} else fprintf(stderr,"komodo_heightstamp null ptr for block.%d\n",height);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user