mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 06:43:45 +01:00
Merge #18960: indexes: Add compact block filter headers cache
0187d4c118[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: ACK0187d4c118theStack: ACK0187d4c118🎉 fjahr: re-utACK0187d4c118laanwj: code review ACK0187d4c118ariard: Code Review ACK0187d4c. Tree-SHA512: 2075ae36901ebcdc4a217eae5203ebc8582181a0831fb7a53a119f031c46bca960a610a38a3d0636a9a405f713efcf4200c85f10c8559fd80139036d89473c56
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user