diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 2a29b1dc9..d575b02b1 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -781,7 +781,7 @@ int32_t komodo_isrealtime(int32_t *kmdheightp) if ( (sp= komodo_stateptrget((char *)"KMD")) != 0 ) *kmdheightp = sp->CURRENT_HEIGHT; 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); else return(0); } diff --git a/src/miner.cpp b/src/miner.cpp index f5543b9e4..c3e14b343 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -121,7 +121,10 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) // Create new block unique_ptr pblocktemplate(new CBlockTemplate()); if(!pblocktemplate.get()) + { + fprintf(stderr,"pblocktemplate.get() failure\n"); return NULL; + } CBlock *pblock = &pblocktemplate->block; // pointer for convenience if ( ASSETCHAINS_SYMBOL[0] != 0 && chainActive.Tip()->nHeight >= ASSETCHAINS_MINHEIGHT ) { @@ -469,7 +472,9 @@ CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey) else { if (!reservekey.GetReservedKey(pubkey)) + { return NULL; + } scriptPubKey.resize(35); ptr = (uint8_t *)pubkey.begin(); script = (uint8_t *)scriptPubKey.data(); @@ -610,7 +615,9 @@ void static BitcoinMiner(CWallet *pwallet) CBlockTemplate *ptr = CreateNewBlockWithKey(reservekey); 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; } unique_ptr pblocktemplate(ptr);