Changeset View
Changeset View
Standalone View
Standalone View
src/index/blockfilterindex.h
// Copyright (c) 2018 The Bitcoin Core developers | // Copyright (c) 2018 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_INDEX_BLOCKFILTERINDEX_H | #ifndef BITCOIN_INDEX_BLOCKFILTERINDEX_H | ||||
#define BITCOIN_INDEX_BLOCKFILTERINDEX_H | #define BITCOIN_INDEX_BLOCKFILTERINDEX_H | ||||
#include <blockfilter.h> | #include <blockfilter.h> | ||||
#include <chain.h> | #include <chain.h> | ||||
#include <flatfile.h> | #include <flatfile.h> | ||||
#include <index/base.h> | #include <index/base.h> | ||||
#include <util/hasher.h> | |||||
/** Interval between compact filter checkpoints. See BIP 157. */ | /** Interval between compact filter checkpoints. See BIP 157. */ | ||||
static constexpr int CFCHECKPT_INTERVAL = 1000; | static constexpr int CFCHECKPT_INTERVAL = 1000; | ||||
struct FilterHeaderHasher { | |||||
size_t operator()(const uint256 &hash) const { | |||||
return ReadLE64(hash.begin()); | |||||
} | |||||
}; | |||||
/** | /** | ||||
* BlockFilterIndex is used to store and retrieve block filters, hashes, and | * BlockFilterIndex is used to store and retrieve block filters, hashes, and | ||||
* headers for a range of blocks by height. An index is constructed for each | * headers for a range of blocks by height. An index is constructed for each | ||||
* supported filter type with its own database (ie. filter data for different | * supported filter type with its own database (ie. filter data for different | ||||
* types are stored in separate databases). | * types are stored in separate databases). | ||||
* | * | ||||
* This index is used to serve BIP 157 net requests. | * This index is used to serve BIP 157 net requests. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines |