Current bitcoin-master on testnet, `maxconnections=8` in the config file. Running in VM that doesn't have public IP and is not reachable from the Internet.

Wait until you have 8 peers.

```
telnet localhost 18333
```

It will result in:

```
Assertion failed: (nMaxInbound > 0), function AcceptConnection, file net.cpp, line 973.
```

First found in https://github.com/bitcoin/bitcoin/pull/8996, but can be reproduced on master.

if (!GetNodeSignals().ProcessMessages(pnode, *this))
                        pnode->CloseSocketDisconnect();
                    if (pnode->nSendSize < GetSendBufferSize())
                    {
                        if (!pnode->vRecvGetData.empty() || (!pnode->vRecvMsg.empty() && pnode->vRecvMsg[0].complete()))
                        {
                            fSleep = false;
                        }
                    }
                }
            }
            boost::this_thread::interruption_point();
            
            {
                TRY_LOCK(pnode->cs_vSend, lockSend);
                if (lockSend)
                    GetNodeSignals().SendMessages(pnode, *this);
            }
            boost::this_thread::interruption_point();
        }
        {
            LOCK(cs_vNodes);
            BOOST_FOREACH(CNode* pnode, vNodesCopy)
                pnode->Release();
        }
        if (fSleep)
            messageHandlerCondition.timed_wait(lock, boost::posix_time::microsec_clock::universal_time() + boost::posix_time::milliseconds(100));
    }
}
bool CConnman::BindListenPort(const CService &addrBind, std::string& strError, bool fWhitelisted)