Skip to content

Commit

Permalink
add support for another filter type without needing to change ther se…
Browse files Browse the repository at this point in the history
…rvice bit
  • Loading branch information
josibake committed Jan 27, 2024
1 parent 0004e6c commit 688e859
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3076,15 +3076,24 @@ bool PeerManagerImpl::ProcessOrphanTx(Peer& peer)

return false;
}

bool IsSupportedFilter(BlockFilterType filter_type)
{
switch (filter_type) {
case BlockFilterType::BASIC:
case BlockFilterType::SILENT_PAYMENTS:
return true;
default:
return false;
}
}
bool PeerManagerImpl::PrepareBlockFilterRequest(CNode& node, Peer& peer,
BlockFilterType filter_type, uint32_t start_height,
const uint256& stop_hash, uint32_t max_height_diff,
const CBlockIndex*& stop_index,
BlockFilterIndex*& filter_index)
{
const bool supported_filter_type =
(filter_type == BlockFilterType::BASIC &&
(IsSupportedFilter(filter_type) &&
(peer.m_our_services & NODE_COMPACT_FILTERS));
if (!supported_filter_type) {
LogPrint(BCLog::NET, "peer %d requested unsupported block filter type: %d\n",
Expand Down

0 comments on commit 688e859

Please sign in to comment.