void PeerSet::sendRequest (const protocol::TMGetLedger& tmGL, Peer::ptr const& peer) { if (!peer) sendRequest (tmGL); else peer->send (std::make_shared<Message> (tmGL, protocol::mtGET_LEDGER)); }
void PeerSet::sendRequest (const protocol::TMGetLedger& tmGL) { ScopedLockType sl (mLock); if (mPeers.empty ()) return; Message::pointer packet ( std::make_shared<Message> (tmGL, protocol::mtGET_LEDGER)); for (auto const& p : mPeers) { Peer::ptr peer (app_.overlay ().findPeerByShortID (p.first)); if (peer) peer->send (packet); } }