aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@protonmail.com>2020-05-21 18:09:24 +0200
committerWladimir J. van der Laan <laanwj@protonmail.com>2020-05-21 19:34:29 +0200
commit4479eb04d92806633aa3ad3e413f6a7166863638 (patch)
tree6cf61d79794ae455322a3340e8c95379f13bb2c2 /src/net_processing.cpp
parentfed1a9043fdf802c7cf7eab1c8aab25ca1c90e8d (diff)
parent0187d4c118ab4c0f5c2d4fb180c2a8dea8ac53cf (diff)
Merge #18960: indexes: Add compact block filter headers cache
0187d4c118ab4c0f5c2d4fb180c2a8dea8ac53cf [indexes] Add compact block filter headers cache (John Newbery) Pull request description: Cache block filter headers at heights of multiples of 1000 in memory. Block filter headers at height 1000x are checkpointed, and will be the most frequently requested. Cache them in memory to avoid costly disk reads. ACKs for top commit: jkczyz: ACK 0187d4c118ab4c0f5c2d4fb180c2a8dea8ac53cf theStack: ACK 0187d4c118ab4c0f5c2d4fb180c2a8dea8ac53cf :tada: fjahr: re-utACK 0187d4c118ab4c0f5c2d4fb180c2a8dea8ac53cf laanwj: code review ACK 0187d4c118ab4c0f5c2d4fb180c2a8dea8ac53cf ariard: Code Review ACK 0187d4c. Tree-SHA512: 2075ae36901ebcdc4a217eae5203ebc8582181a0831fb7a53a119f031c46bca960a610a38a3d0636a9a405f713efcf4200c85f10c8559fd80139036d89473c56
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 018541a597..9d9e31d3ed 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -129,8 +129,6 @@ static constexpr unsigned int INVENTORY_BROADCAST_MAX = 7 * INVENTORY_BROADCAST_
static constexpr unsigned int AVG_FEEFILTER_BROADCAST_INTERVAL = 10 * 60;
/** Maximum feefilter broadcast delay after significant change. */
static constexpr unsigned int MAX_FEEFILTER_CHANGE_DELAY = 5 * 60;
-/** Interval between compact filter checkpoints. See BIP 157. */
-static constexpr int CFCHECKPT_INTERVAL = 1000;
struct COrphanTx {
// When modifying, adapt the copy of this definition in tests/DoS_tests.
@@ -1994,7 +1992,7 @@ static bool PrepareBlockFilterRequest(CNode* pfrom, const CChainParams& chain_pa
BlockFilterType filter_type,
const uint256& stop_hash,
const CBlockIndex*& stop_index,
- const BlockFilterIndex*& filter_index)
+ BlockFilterIndex*& filter_index)
{
const bool supported_filter_type =
(filter_type == BlockFilterType::BASIC &&
@@ -2049,7 +2047,7 @@ static void ProcessGetCFCheckPt(CNode* pfrom, CDataStream& vRecv, const CChainPa
const BlockFilterType filter_type = static_cast<BlockFilterType>(filter_type_ser);
const CBlockIndex* stop_index;
- const BlockFilterIndex* filter_index;
+ BlockFilterIndex* filter_index;
if (!PrepareBlockFilterRequest(pfrom, chain_params, filter_type, stop_hash,
stop_index, filter_index)) {
return;