Simplify PeerSet, InboundLedger and TransactionAcquire:

* Use std::mutex instead of std::recursive_mutex
* Remove unnecessary type alias
* Use std::set instead of ripple::hash_map
* Don't reinvent virtual functions
This commit is contained in:
Nik Bougalis
2016-05-31 00:05:25 -07:00
parent d1200224e2
commit 279c2a6f82
13 changed files with 106 additions and 129 deletions

View File

@@ -57,7 +57,7 @@ struct get_peer_json
get_peer_json ()
{ }
void operator() (Peer::ptr const& peer)
void operator() (std::shared_ptr<Peer> const& peer)
{
json.append (peer->json ());
}
@@ -930,14 +930,14 @@ OverlayImpl::check ()
});
}
Peer::ptr
std::shared_ptr<Peer>
OverlayImpl::findPeerByShortID (Peer::id_t const& id)
{
std::lock_guard <decltype(mutex_)> lock (mutex_);
auto const iter = ids_.find (id);
if (iter != ids_.end ())
return iter->second.lock();
return Peer::ptr();
return {};
}
void