test
This commit is contained in:
29
src/komodo.h
29
src/komodo.h
@@ -23,30 +23,29 @@ int32_t IS_KOMODO_NOTARY,USE_EXTERNAL_PUBKEY,NOTARIZED_HEIGHT;
|
||||
std::string NOTARY_PUBKEY;
|
||||
uint256 NOTARIZED_HASH;
|
||||
|
||||
int32_t komodo_checkmsg(void *bitcoinpeer,uint8_t *data,int32_t datalen)
|
||||
int32_t komodo_blockindexcheck(CBlockIndex *pindex,uint32_t *nBitsp)
|
||||
{
|
||||
fprintf(stderr,"KOMODO.[%d] message from peer.%p\n",datalen,bitcoinpeer);
|
||||
CBlock block;
|
||||
if ( ReadBlockFromDisk(block,pindex) == 0 )
|
||||
return(-1);
|
||||
// extract height from coinbase
|
||||
// extract miner's pubkey from vout[0]
|
||||
// compare against elected notary pubkeys as of height
|
||||
|
||||
// 1 -> valid notary block, change nBits to KOMODO_MINDIFF_NBITS
|
||||
// -1 -> invalid, ie, prior to notarized block
|
||||
return(0);
|
||||
}
|
||||
|
||||
void komodo_connectblock(CBlock *block)
|
||||
void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
|
||||
{
|
||||
// update voting results and official (height, notaries[])
|
||||
}
|
||||
|
||||
int32_t komodo_blockindexcheck(CBlockIndex *pindex,uint32_t *nBitsp)
|
||||
{
|
||||
// extract height from coinbase
|
||||
// extract miner's pubkey from vout[0]
|
||||
// compare against elected notary pubkeys as of height
|
||||
return(0); // normal PoW block
|
||||
}
|
||||
|
||||
int32_t komodo_is_notaryblock(CBlockHeader& blockhdr)
|
||||
{
|
||||
// 1 -> valid notary block, change nBits to KOMODO_MINDIFF_NBITS
|
||||
// -1 -> invalid, ie, prior to notarized block
|
||||
return(0);
|
||||
uint32_t nBits = 0;
|
||||
return(komodo_blockindexcheck(mapBlockIndex[blockhdr.GetHash()],&nBits));
|
||||
}
|
||||
|
||||
int32_t komodo_blockhdrcheck(CBlockHeader& blockhdr,uint32_t *nBitsp)
|
||||
@@ -58,7 +57,7 @@ int32_t komodo_blockhdrcheck(CBlockHeader& blockhdr,uint32_t *nBitsp)
|
||||
|
||||
int32_t komodo_blockcheck(CBlock& block,uint32_t *nBitsp)
|
||||
{
|
||||
komodo_blockhdrcheck(block,nBitsp);
|
||||
return(komodo_blockhdrcheck(block,nBitsp));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user