Test
This commit is contained in:
@@ -781,7 +781,7 @@ int32_t komodo_isrealtime(int32_t *kmdheightp)
|
|||||||
if ( (sp= komodo_stateptrget((char *)"KMD")) != 0 )
|
if ( (sp= komodo_stateptrget((char *)"KMD")) != 0 )
|
||||||
*kmdheightp = sp->CURRENT_HEIGHT;
|
*kmdheightp = sp->CURRENT_HEIGHT;
|
||||||
else *kmdheightp = 0;
|
else *kmdheightp = 0;
|
||||||
if ( (pindex= chainActive.Tip()) != 0 && pindex->nHeight == (int32_t)komodo_longestchain() )
|
if ( (pindex= chainActive.Tip()) != 0 && pindex->nHeight >= (int32_t)komodo_longestchain() )
|
||||||
return(1);
|
return(1);
|
||||||
else return(0);
|
else return(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,7 +121,10 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
|
|||||||
// Create new block
|
// Create new block
|
||||||
unique_ptr<CBlockTemplate> pblocktemplate(new CBlockTemplate());
|
unique_ptr<CBlockTemplate> pblocktemplate(new CBlockTemplate());
|
||||||
if(!pblocktemplate.get())
|
if(!pblocktemplate.get())
|
||||||
|
{
|
||||||
|
fprintf(stderr,"pblocktemplate.get() failure\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
CBlock *pblock = &pblocktemplate->block; // pointer for convenience
|
CBlock *pblock = &pblocktemplate->block; // pointer for convenience
|
||||||
if ( ASSETCHAINS_SYMBOL[0] != 0 && chainActive.Tip()->nHeight >= ASSETCHAINS_MINHEIGHT )
|
if ( ASSETCHAINS_SYMBOL[0] != 0 && chainActive.Tip()->nHeight >= ASSETCHAINS_MINHEIGHT )
|
||||||
{
|
{
|
||||||
@@ -469,7 +472,9 @@ CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!reservekey.GetReservedKey(pubkey))
|
if (!reservekey.GetReservedKey(pubkey))
|
||||||
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
scriptPubKey.resize(35);
|
scriptPubKey.resize(35);
|
||||||
ptr = (uint8_t *)pubkey.begin();
|
ptr = (uint8_t *)pubkey.begin();
|
||||||
script = (uint8_t *)scriptPubKey.data();
|
script = (uint8_t *)scriptPubKey.data();
|
||||||
@@ -610,7 +615,9 @@ void static BitcoinMiner(CWallet *pwallet)
|
|||||||
CBlockTemplate *ptr = CreateNewBlockWithKey(reservekey);
|
CBlockTemplate *ptr = CreateNewBlockWithKey(reservekey);
|
||||||
if ( ptr == 0 )
|
if ( ptr == 0 )
|
||||||
{
|
{
|
||||||
fprintf(stderr,"created illegal block, retry\n");
|
static int32_t counter;
|
||||||
|
if ( counter++ < 100 )
|
||||||
|
fprintf(stderr,"created illegal block, retry\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
unique_ptr<CBlockTemplate> pblocktemplate(ptr);
|
unique_ptr<CBlockTemplate> pblocktemplate(ptr);
|
||||||
|
|||||||
Reference in New Issue
Block a user