This commit is contained in:
jl777
2017-03-24 01:19:53 +02:00
parent 88416f2bc9
commit 7d44d3dddd
2 changed files with 28 additions and 11 deletions

View File

@@ -594,6 +594,25 @@ int32_t komodo_blockload(CBlock& block,CBlockIndex *pindex)
return(0);
}
CBlockIndex *komodo_chainactive(int32_t height)
{
if ( chainActive.Tip() != 0 && height <= chainActive.Tip()->nHeight )
{
return(chainActive[height]);
} else return(0);
}
uint32_t komodo_heightstamp(int32_t height)
{
CBlock block; CBlockIndex *ptr;
if ( (ptr= komodo_chainactive(height)) != 0 )
{
if ( komodo_blockload(block,ptr) == 0 && komodo_block2height(&block) == height )
return(block.nTime);
}
return(0);
}
void komodo_index2pubkey33(uint8_t *pubkey33,CBlockIndex *pindex,int32_t height)
{
CBlock block;
@@ -618,14 +637,6 @@ void komodo_connectpindex(CBlockIndex *pindex)
komodo_connectblock(pindex,block);
}
CBlockIndex *komodo_chainactive(int32_t height)
{
if ( chainActive.Tip() != 0 && height <= chainActive.Tip()->nHeight )
{
return(chainActive[height]);
} else return(0);
}
int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t height);
int32_t komodo_electednotary(uint8_t *pubkey33,int32_t height);