Test
This commit is contained in:
@@ -725,13 +725,13 @@ uint32_t komodo_heightstamp(int32_t height)
|
|||||||
void komodo_pindex_init(CBlockIndex *pindex,int32_t height)
|
void komodo_pindex_init(CBlockIndex *pindex,int32_t height)
|
||||||
{
|
{
|
||||||
int32_t i,num; uint8_t pubkeys[64][33]; CBlock block;
|
int32_t i,num; uint8_t pubkeys[64][33]; CBlock block;
|
||||||
printf("pindex.%d komodo_pindex_init notary.%d from height.%d\n",pindex->nHeight,pindex->notaryid,height);
|
|
||||||
if ( pindex->notaryid >= 0 && (pindex->pubkey33[0] == 2 || pindex->pubkey33[0] == 3) )
|
if ( pindex->notaryid >= 0 && (pindex->pubkey33[0] == 2 || pindex->pubkey33[0] == 3) )
|
||||||
return;
|
return;
|
||||||
|
printf("pindex.%d komodo_pindex_init notary.%d from height.%d\n",pindex->nHeight,pindex->notaryid,height);
|
||||||
pindex->notaryid = -1;
|
pindex->notaryid = -1;
|
||||||
if ( pindex->pubkey33[0] != 2 && pindex->pubkey33[0] != 3 )
|
if ( pindex->pubkey33[0] != 2 && pindex->pubkey33[0] != 3 && pindex->pubkey33[0] != 0xff )
|
||||||
{
|
{
|
||||||
memset(pindex->pubkey33,0,33);
|
memset(pindex->pubkey33,0xff,33);
|
||||||
if ( komodo_blockload(block,pindex) == 0 )
|
if ( komodo_blockload(block,pindex) == 0 )
|
||||||
{
|
{
|
||||||
komodo_block2pubkey33(pindex->pubkey33,block);
|
komodo_block2pubkey33(pindex->pubkey33,block);
|
||||||
|
|||||||
10
src/main.cpp
10
src/main.cpp
@@ -4091,7 +4091,7 @@ CBlockIndex * InsertBlockIndex(uint256 hash)
|
|||||||
return pindexNew;
|
return pindexNew;
|
||||||
}
|
}
|
||||||
|
|
||||||
void komodo_pindex_init(CBlockIndex *pindex,int32_t height);
|
//void komodo_pindex_init(CBlockIndex *pindex,int32_t height);
|
||||||
|
|
||||||
bool static LoadBlockIndexDB()
|
bool static LoadBlockIndexDB()
|
||||||
{
|
{
|
||||||
@@ -4108,7 +4108,7 @@ bool static LoadBlockIndexDB()
|
|||||||
{
|
{
|
||||||
CBlockIndex* pindex = item.second;
|
CBlockIndex* pindex = item.second;
|
||||||
vSortedByHeight.push_back(make_pair(pindex->nHeight, pindex));
|
vSortedByHeight.push_back(make_pair(pindex->nHeight, pindex));
|
||||||
komodo_pindex_init(pindex,(int32_t)pindex->nHeight);
|
//komodo_pindex_init(pindex,(int32_t)pindex->nHeight);
|
||||||
}
|
}
|
||||||
sort(vSortedByHeight.begin(), vSortedByHeight.end());
|
sort(vSortedByHeight.begin(), vSortedByHeight.end());
|
||||||
BOOST_FOREACH(const PAIRTYPE(int, CBlockIndex*)& item, vSortedByHeight)
|
BOOST_FOREACH(const PAIRTYPE(int, CBlockIndex*)& item, vSortedByHeight)
|
||||||
@@ -4157,7 +4157,7 @@ bool static LoadBlockIndexDB()
|
|||||||
pindex->BuildSkip();
|
pindex->BuildSkip();
|
||||||
if (pindex->IsValid(BLOCK_VALID_TREE) && (pindexBestHeader == NULL || CBlockIndexWorkComparator()(pindexBestHeader, pindex)))
|
if (pindex->IsValid(BLOCK_VALID_TREE) && (pindexBestHeader == NULL || CBlockIndexWorkComparator()(pindexBestHeader, pindex)))
|
||||||
pindexBestHeader = pindex;
|
pindexBestHeader = pindex;
|
||||||
komodo_pindex_init(pindex,(int32_t)pindex->nHeight);
|
//komodo_pindex_init(pindex,(int32_t)pindex->nHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load block file info
|
// Load block file info
|
||||||
@@ -4186,7 +4186,7 @@ bool static LoadBlockIndexDB()
|
|||||||
if (pindex->nStatus & BLOCK_HAVE_DATA) {
|
if (pindex->nStatus & BLOCK_HAVE_DATA) {
|
||||||
setBlkDataFiles.insert(pindex->nFile);
|
setBlkDataFiles.insert(pindex->nFile);
|
||||||
}
|
}
|
||||||
komodo_pindex_init(pindex,(int32_t)pindex->nHeight);
|
//komodo_pindex_init(pindex,(int32_t)pindex->nHeight);
|
||||||
}
|
}
|
||||||
for (std::set<int>::iterator it = setBlkDataFiles.begin(); it != setBlkDataFiles.end(); it++)
|
for (std::set<int>::iterator it = setBlkDataFiles.begin(); it != setBlkDataFiles.end(); it++)
|
||||||
{
|
{
|
||||||
@@ -4222,7 +4222,7 @@ bool static LoadBlockIndexDB()
|
|||||||
if (pindex->pprev) {
|
if (pindex->pprev) {
|
||||||
pindex->pprev->hashAnchorEnd = pindex->hashAnchor;
|
pindex->pprev->hashAnchorEnd = pindex->hashAnchor;
|
||||||
}
|
}
|
||||||
komodo_pindex_init(pindex,(int32_t)pindex->nHeight);
|
//komodo_pindex_init(pindex,(int32_t)pindex->nHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load pointer to end of best chain
|
// Load pointer to end of best chain
|
||||||
|
|||||||
@@ -145,6 +145,8 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in
|
|||||||
}
|
}
|
||||||
if ( height > 34000 && ASSETCHAINS_SYMBOL[0] == 0 ) // 0 -> non-special notary
|
if ( height > 34000 && ASSETCHAINS_SYMBOL[0] == 0 ) // 0 -> non-special notary
|
||||||
{
|
{
|
||||||
|
if ( (pindex= komodo_chainactive(height)) != 0 )
|
||||||
|
komodo_pindex_init(pindex,height);
|
||||||
special = komodo_chosennotary(¬aryid,height,pubkey33,timestamp);
|
special = komodo_chosennotary(¬aryid,height,pubkey33,timestamp);
|
||||||
for (i=0; i<33; i++)
|
for (i=0; i<33; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user