This is happening because your node thinks it is in initial block download.
There are several reasons why that might happen, but I think only two apply here.
- The chain tip is more than
nMaxTipAge seconds old. Try setting the -maxtipage option to a big number, and see if that fixes it.
- The chain tip has less than
nMinimumChainWork (from chainparams.cpp) of work put into it.
Here are the conditions that trigger initial block download:
bool IsInitialBlockDownload()
{
const CChainParams& chainParams = Params();
// Once this function has returned false, it must remain false.
static std::atomic<bool> latchToFalse{false};
// Optimization: pre-test latch before taking the lock.
if (latchToFalse.load(std::memory_order_relaxed))
return false;
LOCK(cs_main);
if (latchToFalse.load(std::memory_order_relaxed))
return false;
if (fImporting || fReindex)
return true;
if (chainActive.Tip() == NULL)
return true;
if (chainActive.Tip()->nChainWork < UintToArith256(chainParams.GetConsensus().nMinimumChainWork))
return true;
if (chainActive.Tip()->GetBlockTime() < (GetTime() - nMaxTipAge))
return true;
latchToFalse.store(true, std::memory_order_relaxed);
return false;
}
Not sure if this maybe related to ammount of blocks. I used old code to mine a block, maybe this is an issue too? Do you know the right way how to premine ? – Wojtek B – 2017-08-01T22:01:51.437
OK, possible I took right assumption. However still not sychronize. I have generated ~100 blocks and the second node can see it "Received satoshi...block: 100" but then do nothing... Debug file says: getheaders -1 to 000000... – Wojtek B – 2017-08-02T18:20:07.977