This commit is contained in:
jl777
2016-10-03 11:32:30 -03:00
parent 76c0be99bc
commit 3d35aa5b13
5 changed files with 35 additions and 19 deletions

View File

@@ -22,15 +22,16 @@
int32_t IS_KOMODO_NOTARY,USE_EXTERNAL_PUBKEY;
std::string NOTARY_PUBKEY;
int32_t komodo_is_notaryblock(uint8_t *pblock)
void komodo_connectblock(CBlock *block)
{
/*int32_t i;
for (i=0; i<5; i++)
printf("%02x",coinbase[i]);
printf(" <- coinbase\n");
for (i=0; i<35; i++)
printf("%02x",minerout[i]);
printf(" <- minerout\n");*/
// update voting results and official (height, notaries[])
}
int32_t komodo_is_notaryblock(CBlockHeader *blockhdr)
{
// extract height from coinbase
// extract miner's pubkey from vout[0]
// compare against elected notary pubkeys as of height
return(0);
}
@@ -40,7 +41,22 @@ int32_t komodo_checkmsg(void *bitcoinpeer,uint8_t *data,int32_t datalen)
return(0);
}
int32_t komodo_blockcheck(void *block,uint32_t *nBitsp)
int32_t komodo_blockhdrcheck(CBlockHeader *blockhdr,uint32_t *nBitsp)
{
if ( komodo_is_notaryblock(blockhdr) != 0 )
*nBitsp = KOMODO_MINDIFF_NBITS;
//fprintf(stderr,"check block %p\n",block);
// 1 -> valid notary block, change nBits to KOMODO_MINDIFF_NBITS
// -1 -> invalid, ie, prior to notarized block
return(0); // normal PoW block
}
int32_t komodo_blockindexcheck(CBlockIndex *pindex,uint32_t *nBitsp)
{
}
int32_t komodo_blockcheck(CBlock *block,uint32_t *nBitsp)
{
//fprintf(stderr,"check block %p\n",block);
// 1 -> valid notary block, change nBits to KOMODO_MINDIFF_NBITS