This commit is contained in:
jl777
2016-10-20 12:20:58 -03:00
parent 76ece18b5c
commit 7f18fdc406
2 changed files with 3 additions and 51 deletions

View File

@@ -20,6 +20,7 @@
#include <stdio.h>
#define KOMODO_TESTNET_EXPIRATION 60000
#define KOMODOE_PUBKEYS_HEIGHT(height) (((((height)+500)/1000) + 1) * 1000)
int32_t IS_KOMODO_NOTARY,USE_EXTERNAL_PUBKEY,NOTARIZED_HEIGHT,Num_nutxos,KOMODO_NUMNOTARIES = 64;
std::string NOTARY_PUBKEY;
@@ -504,7 +505,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
memset(&txhash,0,sizeof(txhash));
komodo_stateupdate(height,pubkeys,numvalid,0,txhash,0,0);
}
printf("new notaries.%d newheight.%d from height.%d\n",numvouts-1,(((height+500)/1000)+1)*1000,height);
printf("new notaries.%d newheight.%d from height.%d\n",numvouts-1,KOMODO_PUBKEYHEIGHT(height),height);
}
}
}
@@ -575,53 +576,4 @@ void komodo_index2pubkey33(uint8_t *pubkey33,CBlockIndex *pindex,int32_t height)
}
}
/*int32_t komodo_blockindexcheck(CBlockIndex *pindex,uint32_t *nBitsp)
{
// 1 -> valid notary block, change nBits to KOMODO_MINDIFF_NBITS
// -1 -> invalid, ie, prior to notarized block
CBlock block; int32_t i,height; char *coinbasestr;
if ( pindex == 0 )
return(0);
if ( ReadBlockFromDisk(block,pindex,1) == 0 )
return(0);
if ( block.vtx.size() > 0 )
{
height = pindex->nHeight;
coinbasestr = (char *)block.vtx[0].vout[0].scriptPubKey.ToString().c_str();
for (i=0; i<64; i++)
{
if ( Notaries[i][0] == 0 || Notaries[i][1] == 0 || Notaries[i][0][0] == 0 || Notaries[i][1][0] == 0 )
break;
if ( strncmp(Notaries[i][1],coinbasestr,66) == 0 )
{
//printf("Notary.[%d] %s ht.%d (%s)\n",i,Notaries[i][0],height,coinbasestr);
//*nBitsp = KOMODO_MINDIFF_NBITS;
return(1);
}
}
}
// compare against elected notary pubkeys as of height
return(0);
}
int32_t komodo_is_notaryblock(CBlockHeader& blockhdr)
{
//uint32_t nBits = 0;
//return(komodo_blockindexcheck(mapBlockIndex[blockhdr.GetHash()],&nBits));
return(0);
}
int32_t komodo_blockhdrcheck(CBlockHeader& blockhdr,uint32_t *nBitsp)
{
int32_t retval;
if ( (retval= komodo_is_notaryblock(blockhdr)) > 0 )
*nBitsp = KOMODO_MINDIFF_NBITS;
return(retval);
}
int32_t komodo_blockcheck(CBlock& block,uint32_t *nBitsp)
{
return(komodo_blockhdrcheck(block,nBitsp));
}*/
#endif

View File

@@ -112,7 +112,7 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in
arith_uint256 bnTarget;
bnTarget.SetCompact(nBits, &fNegative, &fOverflow);
if ( height >= 33310 && (special= komodo_heightnotary(height,pubkey33)) != 0 ) // 0 -> non-special notary
if ( height >= 33325 && (special= komodo_heightnotary(height,pubkey33)) != 0 ) // 0 -> non-special notary
{
int32_t i,nonz = 0;
for (i=0; i<33; i++)