Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 3,327 Lines • ▼ Show 20 Lines | if (msg_type == NetMsgType::GETHEADERS) { | ||||
pindex ? pindex : ::ChainActive().Tip(); | pindex ? pindex : ::ChainActive().Tip(); | ||||
m_connman.PushMessage(&pfrom, | m_connman.PushMessage(&pfrom, | ||||
msgMaker.Make(NetMsgType::HEADERS, vHeaders)); | msgMaker.Make(NetMsgType::HEADERS, vHeaders)); | ||||
return; | return; | ||||
} | } | ||||
if (msg_type == NetMsgType::TX) { | if (msg_type == NetMsgType::TX) { | ||||
// Stop processing the transaction early if | // Stop processing the transaction early if | ||||
// We are in blocks only mode and peer is either not whitelisted or | // 1) We are in blocks only mode and peer has no relay permission | ||||
// whitelistrelay is off or if this peer is supposed to be a | // 2) This peer is a block-relay-only peer | ||||
// block-relay-only peer | |||||
if ((!g_relay_txes && !pfrom.HasPermission(PF_RELAY)) || | if ((!g_relay_txes && !pfrom.HasPermission(PF_RELAY)) || | ||||
(pfrom.m_tx_relay == nullptr)) { | (pfrom.m_tx_relay == nullptr)) { | ||||
LogPrint(BCLog::NET, | LogPrint(BCLog::NET, | ||||
"transaction sent in violation of protocol peer=%d\n", | "transaction sent in violation of protocol peer=%d\n", | ||||
pfrom.GetId()); | pfrom.GetId()); | ||||
pfrom.fDisconnect = true; | pfrom.fDisconnect = true; | ||||
return; | return; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 2,179 Lines • Show Last 20 Lines |