mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user