Sometimes impossible to start new node: moved from presstab/crown-core#4
Summary
Attempted to restart a node which was orphaned from the network. Started with an empty datadir/testnet3. It synced to a certain block (in this case 15742) and for the next several hours did nothing but complain "CreateCoinStake -- Couldn't find CMasternode object for active masternode" and occasionally disconnect a peer using the wrong code version.
...
2018-12-22 05:57:06 CheckProofOfStake : OutPoint: bd2da7fe31d1ac069027a77f8f01a7884e2bea82392da09bbd3489894335e5c2:1 Modifier=bab058a9f757d49510dee7e47e48f1a438a6851e637b72debfa1e17eaecd830e timeblockfrom=1544703155 time=1544733754 amount=10000
2018-12-22 05:57:06 UpdateTip: new best=04f7ad4c67ade872c30ddf1e0b5d472069b12aaf6f2b8b1dddd1da26cddd7ca9 height=15742 log2_work=39.595891 tx=21692 date=2018-12-13 20:42:34 progress=0.446495 cache=4.6MiB(18508tx)
2018-12-22 05:57:06 ProcessNewBlock : ACCEPTED
2018-12-22 05:57:06 CreateCoinStake -- Couldn't find CMasternode object for active masternode
2018-12-22 05:57:07 CreateCoinStake -- Couldn't find CMasternode object for active masternode
2018-12-22 05:57:08 CreateCoinStake -- Couldn't find CMasternode object for active masternode
2018-12-22 05:57:10 CreateCoinStake -- Couldn't find CMasternode object for active masternode
2018-12-22 05:57:11 CreateCoinStake -- Couldn't find CMasternode object for active masternode
2018-12-22 05:57:12 CreateCoinStake -- Couldn't find CMasternode object for active masternode
2018-12-22 05:57:13 CreateCoinStake -- Couldn't find CMasternode object for active masternode
2018-12-22 05:57:14 CreateCoinStake -- Couldn't find CMasternode object for active masternode
...
2018-12-22 06:33:15 CreateCoinStake -- Couldn't find CMasternode object for active masternode
2018-12-22 06:33:16 peer=60 using obsolete version 70054; disconnecting
2018-12-22 06:33:16 ProcessMessage(version, 105 bytes) FAILED peer=60
2018-12-22 06:33:16 CreateCoinStake -- Couldn't find CMasternode object for active masternode
...
2018-12-22 11:10:06 CreateCoinStake -- Couldn't find CMasternode object for active masternode
2018-12-22 11:10:07 CreateCoinStake -- Couldn't find CMasternode object for active masternode
2018-12-22 11:10:08 CreateCoinStake -- Couldn't find CMasternode object for active masternode
Steps to reproduce
Attempt to start a node. Difficult to say how often the problem occurs and whether it makes a significant difference if starting with a clean datadir. Maybe happens 10% of the time?
Expected behavior
Node should start cleanly every time.
Problematic behavior
Node sometimes fails to complete sync.
Crown-core environment info
Ubuntu 16.04 64-bit
Crown-core application info
Crown version v0.12.5.1-5184c558 (2018-12-07 13:59:07 -0700) (pipeline 848)
Relevant logs and/or screenshots
Where can we post whole logs? They're too big to copy'n'paste here.
Possible fixes
Possibly related to the small size of the testnet and the "lumpy" block generation but mainnet will have to successfully pass through a small network phase on the way to 3000+ nodes.
We need to know what causes these problems and fix them or know how to mitigate against them