message: Replace LockAssertion with a proper thread safety annotations
diff: @@ -670,8 +670,8 @@ static void MaybeSetPeerAsAnnouncingHeaderAndIDs(NodeId nodeid, CConnman& connma
  return;
  }
  }
  - connman.ForNode(nodeid, [&connman](CNode* pfrom){
  - LockAssertion lock(::cs_main);
  + connman.ForNode(nodeid, [&connman](CNode* pfrom) EXCLUSIVE_LOCKS_REQUIRED(::cs_main) {
  + AssertLockHeld(::cs_main);
  uint64_t nCMPCTBLOCKVersion = (pfrom->GetLocalServices() & NODE_WITNESS) ? 2 : 1;
  if (lNodesAnnouncingHeaderAndIDs.size() >= 3) {
  // As per BIP152, we only get 3 of our peers to announce
  @@ -1357,8 +1357,8 @@ void PeerManager::NewPoWValidBlock(const CBlockIndex *pindex, const std::shared_
  fWitnessesPresentInMostRecentCompactBlock = fWitnessEnabled;
  }
  - m_connman.ForEachNode([this, &pcmpctblock, pindex, &msgMaker, fWitnessEnabled, &hashBlock](CNode* pnode) {
  - LockAssertion lock(::cs_main);
  + m_connman.ForEachNode([this, &pcmpctblock, pindex, &msgMaker, fWitnessEnabled, &hashBlock](CNode* pnode) EXCLUSIVE_LOCKS_REQUIRED(::cs_main) {
  + AssertLockHeld(::cs_main);
  // TODO: Avoid the repeated-serialization here
  if (pnode->GetCommonVersion() < INVALID_CB_NO_BAN_VERSION || pnode->fDisconnect)
  @@ -1491,9 +1491,8 @@ bool static AlreadyHaveBlock(const uint256& block_hash) EXCLUSIVE_LOCKS_REQUIRED
  void RelayTransaction(const uint256& txid, const uint256& wtxid, const CConnman& connman)
  {
  - connman.ForEachNode([&txid, &wtxid](CNode* pnode)
  - {
  - LockAssertion lock(::cs_main);
  + connman.ForEachNode([&txid, &wtxid](CNode* pnode) EXCLUSIVE_LOCKS_REQUIRED(::cs_main) {
  + AssertLockHeld(::cs_main);
  CNodeState* state = State(pnode->GetId());
  if (state == nullptr) return;
  @@ -4106,8 +4105,8 @@ void PeerManager::EvictExtraOutboundPeers(int64_t time_in_seconds)
  NodeId worst_peer = -1;
  int64_t oldest_block_announcement = std::numeric_limits<int64_t>::max();
  - m_connman.ForEachNode([&](CNode* pnode) {
  - LockAssertion lock(::cs_main);
  + m_connman.ForEachNode([&](CNode* pnode) EXCLUSIVE_LOCKS_REQUIRED(::cs_main) {
  + AssertLockHeld(::cs_main);
  // Ignore non-outbound peers, or nodes marked for disconnect already
  if (!pnode->IsOutboundOrBlockRelayConn() || pnode->fDisconnect) return;
  @@ -4123,8 +4122,8 @@ void PeerManager::EvictExtraOutboundPeers(int64_t time_in_seconds)
  }
  });
  if (worst_peer != -1) {
  - bool disconnected = m_connman.ForNode(worst_peer, [&](CNode *pnode) {
  - LockAssertion lock(::cs_main);
  + bool disconnected = m_connman.ForNode(worst_peer, [&](CNode* pnode) EXCLUSIVE_LOCKS_REQUIRED(::cs_main) {
  + AssertLockHeld(::cs_main);
  // Only disconnect a peer that has been connected to us for
  // some reasonable fraction of our check-frequency, to give
  