message: Locking example of GUARDED_BY.
diff: @@ -112,11 +112,11 @@ struct COrphanTx {
  CTransaction tx;
  NodeId fromPeer;
  };
  -std::map<uint256, COrphanTx> mapOrphanTransactions;
  -std::map<uint256, std::set<uint256> > mapOrphanTransactionsByPrev;
  +std::map<uint256, COrphanTx> mapOrphanTransactions GUARDED_BY(cs_main);
  +std::map<uint256, std::set<uint256> > mapOrphanTransactionsByPrev GUARDED_BY(cs_main);
  std::map<uint256, int64_t> mapRejectedBlocks;
  -void EraseOrphansFor(NodeId peer);
  +void EraseOrphansFor(NodeId peer) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
  static void CheckBlockIndex();
  @@ -634,7 +634,7 @@ CSporkDB* pSporkDB = NULL;
  // mapOrphanTransactions
  //
  -bool AddOrphanTx(const CTransaction& tx, NodeId peer)
  +bool AddOrphanTx(const CTransaction& tx, NodeId peer) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
  {
  uint256 hash = tx.GetHash();
  if (mapOrphanTransactions.count(hash))
  @@ -663,7 +663,7 @@ bool AddOrphanTx(const CTransaction& tx, NodeId peer)
  return true;
  }
  -void static EraseOrphanTx(uint256 hash)
  +void static EraseOrphanTx(uint256 hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
  {
  std::map<uint256, COrphanTx>::iterator it = mapOrphanTransactions.find(hash);
  if (it == mapOrphanTransactions.end())
  @@ -679,7 +679,7 @@ void static EraseOrphanTx(uint256 hash)
  mapOrphanTransactions.erase(it);
  }
  -void EraseOrphansFor(NodeId peer)
  +void EraseOrphansFor(NodeId peer) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
  {
  int nErased = 0;
  std::map<uint256, COrphanTx>::iterator iter = mapOrphanTransactions.begin();
  @@ -694,7 +694,7 @@ void EraseOrphansFor(NodeId peer)
  }
  -unsigned int LimitOrphanTxSize(unsigned int nMaxOrphans)
  +unsigned int LimitOrphanTxSize(unsigned int nMaxOrphans) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
  {
  unsigned int nEvicted = 0;
  while (mapOrphanTransactions.size() > nMaxOrphans) {
  @@ -4856,7 +4856,7 @@ std::string GetWarnings(std::string strFor)
  //
  -bool static AlreadyHave(const CInv& inv)
  +bool static AlreadyHave(const CInv& inv) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
  {
  switch (inv.type) {
  case MSG_TX: {
  