Browse Source

Test

pull/4/head
jl777 7 years ago
parent
commit
1b5b89ba20
  1. 2
      src/komodo_bitcoind.h
  2. 9
      src/miner.cpp

2
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);
}

9
src/miner.cpp

@ -121,7 +121,10 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
// Create new block
unique_ptr<CBlockTemplate> 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<CBlockTemplate> pblocktemplate(ptr);

Loading…
Cancel
Save