Reported here: https://github.com/bitcoin/bitcoin/pull/10244#issuecomment-378035305

Travis log here: https://travis-ci.org/bitcoin/bitcoin/jobs/361243719#L2810

Note the JSON exception:

```
test_framework.authproxy.JSONRPCException: The mempool was not loaded yet (-1) 
```

That exception was introduced here: https://github.com/bitcoin/bitcoin/commit/cb1e319fe9e198c9c5cf5236fe9af5a3d748b9e8#diff-a0c8f511d90e83aa9b5857e819ced344R1617

cc @jtimon 
assert(!(pindex->nStatus & BLOCK_HAVE_DATA) == (pindex->nTx == 0));
            assert(pindexFirstMissing == pindexFirstNeverProcessed);
        } else {
            
            if (pindex->nStatus & BLOCK_HAVE_DATA) assert(pindex->nTx > 0);
        }
        if (pindex->nStatus & BLOCK_HAVE_UNDO) assert(pindex->nStatus & BLOCK_HAVE_DATA);
        assert(((pindex->nStatus & BLOCK_VALID_MASK) >= BLOCK_VALID_TRANSACTIONS) == (pindex->nTx > 0)); 
        
        assert((pindexFirstNeverProcessed == nullptr) == pindex->HaveTxsDownloaded());
        assert((pindexFirstNotTransactionsValid == nullptr) == pindex->HaveTxsDownloaded());
        assert(pindex->nHeight == nHeight); 
        assert(pindex->pprev == nullptr || pindex->nChainWork >= pindex->pprev->nChainWork); 
        assert(nHeight < 2 || (pindex->pskip && (pindex->pskip->nHeight < nHeight))); 
        assert(pindexFirstNotTreeValid == nullptr); 
        if ((pindex->nStatus & BLOCK_VALID_MASK) >= BLOCK_VALID_TREE) assert(pindexFirstNotTreeValid == nullptr); 
        if ((pindex->nStatus & BLOCK_VALID_MASK) >= BLOCK_VALID_CHAIN) assert(pindexFirstNotChainValid == nullptr); 
        if ((pindex->nStatus & BLOCK_VALID_MASK) >= BLOCK_VALID_SCRIPTS) assert(pindexFirstNotScriptsValid == nullptr); 
        if (pindexFirstInvalid == nullptr) {
            
            assert((pindex->nStatus & BLOCK_FAILED_MASK) == 0); 
        }
        if (!CBlockIndexWorkComparator()(pindex, chainActive.Tip()) && pindexFirstNeverProcessed == nullptr) {
            if (pindexFirstInvalid == nullptr) {
                
                
                
                
                if (pindexFirstMissing == nullptr || pindex == chainActive.Tip()) {
                    assert(setBlockIndexCandidates.count(pindex));