Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 2,256 Lines • ▼ Show 20 Lines | |||||
* @return True if the request can be serviced. | * @return True if the request can be serviced. | ||||
*/ | */ | ||||
static bool PrepareBlockFilterRequest( | static bool PrepareBlockFilterRequest( | ||||
CNode &peer, const CChainParams &chain_params, BlockFilterType filter_type, | CNode &peer, const CChainParams &chain_params, BlockFilterType filter_type, | ||||
uint32_t start_height, const BlockHash &stop_hash, uint32_t max_height_diff, | uint32_t start_height, const BlockHash &stop_hash, uint32_t max_height_diff, | ||||
const CBlockIndex *&stop_index, BlockFilterIndex *&filter_index) { | const CBlockIndex *&stop_index, BlockFilterIndex *&filter_index) { | ||||
const bool supported_filter_type = | const bool supported_filter_type = | ||||
(filter_type == BlockFilterType::BASIC && | (filter_type == BlockFilterType::BASIC && | ||||
gArgs.GetBoolArg("-peerblockfilters", DEFAULT_PEERBLOCKFILTERS)); | (peer.GetLocalServices() & NODE_COMPACT_FILTERS)); | ||||
if (!supported_filter_type) { | if (!supported_filter_type) { | ||||
LogPrint(BCLog::NET, | LogPrint(BCLog::NET, | ||||
"peer %d requested unsupported block filter type: %d\n", | "peer %d requested unsupported block filter type: %d\n", | ||||
peer.GetId(), static_cast<uint8_t>(filter_type)); | peer.GetId(), static_cast<uint8_t>(filter_type)); | ||||
peer.fDisconnect = true; | peer.fDisconnect = true; | ||||
return false; | return false; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 3,005 Lines • Show Last 20 Lines |