Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 5,375 Lines • ▼ Show 20 Lines | if (pingSend) { | ||||
} | } | ||||
} | } | ||||
} | } | ||||
// | // | ||||
// Message: getdata (transactions) | // Message: getdata (transactions) | ||||
// | // | ||||
for (const TxId &txid : | std::vector<std::pair<NodeId, TxId>> expired; | ||||
m_txrequest.GetRequestable(pto->GetId(), current_time)) { | auto requestable = | ||||
m_txrequest.GetRequestable(pto->GetId(), current_time, &expired); | |||||
for (const auto &entry : expired) { | |||||
LogPrint(BCLog::NET, "timeout of inflight tx %s from peer=%d\n", | |||||
entry.second.ToString(), entry.first); | |||||
} | |||||
for (const TxId &txid : requestable) { | |||||
if (!AlreadyHaveTx(txid, m_mempool)) { | if (!AlreadyHaveTx(txid, m_mempool)) { | ||||
LogPrint(BCLog::NET, "Requesting tx %s peer=%d\n", | LogPrint(BCLog::NET, "Requesting tx %s peer=%d\n", | ||||
txid.ToString(), pto->GetId()); | txid.ToString(), pto->GetId()); | ||||
vGetData.emplace_back(MSG_TX, txid); | vGetData.emplace_back(MSG_TX, txid); | ||||
if (vGetData.size() >= MAX_GETDATA_SZ) { | if (vGetData.size() >= MAX_GETDATA_SZ) { | ||||
m_connman.PushMessage( | m_connman.PushMessage( | ||||
pto, msgMaker.Make(NetMsgType::GETDATA, vGetData)); | pto, msgMaker.Make(NetMsgType::GETDATA, vGetData)); | ||||
vGetData.clear(); | vGetData.clear(); | ||||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |