Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 1,968 Lines • ▼ Show 20 Lines | if (send && pindex->nStatus.hasData()) { | ||||
CInv(MSG_BLOCK, ::ChainActive().Tip()->GetBlockHash())); | CInv(MSG_BLOCK, ::ChainActive().Tip()->GetBlockHash())); | ||||
connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::INV, vInv)); | connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::INV, vInv)); | ||||
pfrom.hashContinue = BlockHash(); | pfrom.hashContinue = BlockHash(); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
static void ProcessGetData(const Config &config, CNode &pfrom, | static void ProcessGetData(const Config &config, CNode &pfrom, | ||||
CConnman &connman, const CTxMemPool &mempool, | CConnman &connman, CTxMemPool &mempool, | ||||
const std::atomic<bool> &interruptMsgProc) | const std::atomic<bool> &interruptMsgProc) | ||||
LOCKS_EXCLUDED(cs_main) { | LOCKS_EXCLUDED(cs_main) { | ||||
AssertLockNotHeld(cs_main); | AssertLockNotHeld(cs_main); | ||||
std::deque<CInv>::iterator it = pfrom.vRecvGetData.begin(); | std::deque<CInv>::iterator it = pfrom.vRecvGetData.begin(); | ||||
std::vector<CInv> vNotFound; | std::vector<CInv> vNotFound; | ||||
const CNetMsgMaker msgMaker(pfrom.GetSendVersion()); | const CNetMsgMaker msgMaker(pfrom.GetSendVersion()); | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | if (pfrom.m_tx_relay != nullptr) { | ||||
((mempool_req.count() && txinfo.m_time <= mempool_req) || | ((mempool_req.count() && txinfo.m_time <= mempool_req) || | ||||
(txinfo.m_time <= longlived_mempool_time))) { | (txinfo.m_time <= longlived_mempool_time))) { | ||||
connman.PushMessage( | connman.PushMessage( | ||||
&pfrom, | &pfrom, | ||||
msgMaker.Make(nSendFlags, NetMsgType::TX, *txinfo.tx)); | msgMaker.Make(nSendFlags, NetMsgType::TX, *txinfo.tx)); | ||||
push = true; | push = true; | ||||
} | } | ||||
} | } | ||||
if (!push) { | |||||
if (push) { | |||||
// We interpret fulfilling a GETDATA for a transaction as a | |||||
// successful initial broadcast and remove it from our | |||||
// unbroadcast set. | |||||
mempool.RemoveUnbroadcastTx(TxId(inv.hash)); | |||||
} else { | |||||
vNotFound.push_back(inv); | vNotFound.push_back(inv); | ||||
} | } | ||||
} | } | ||||
} // release cs_main | } // release cs_main | ||||
if (it != pfrom.vRecvGetData.end() && !pfrom.fPauseSend) { | if (it != pfrom.vRecvGetData.end() && !pfrom.fPauseSend) { | ||||
const CInv &inv = *it; | const CInv &inv = *it; | ||||
if (inv.type == MSG_BLOCK || inv.type == MSG_FILTERED_BLOCK || | if (inv.type == MSG_BLOCK || inv.type == MSG_FILTERED_BLOCK || | ||||
▲ Show 20 Lines • Show All 3,464 Lines • Show Last 20 Lines |