bitcoin/p2p/
message_filter.rs1use crate::bip158::{FilterHash, FilterHeader};
9use crate::blockdata::block::BlockHash;
10use crate::internal_macros::impl_consensus_encoding;
11
12#[derive(PartialEq, Eq, Clone, Debug)]
14pub struct GetCFilters {
15 pub filter_type: u8,
17 pub start_height: u32,
19 pub stop_hash: BlockHash,
21}
22impl_consensus_encoding!(GetCFilters, filter_type, start_height, stop_hash);
23
24#[derive(PartialEq, Eq, Clone, Debug)]
26pub struct CFilter {
27 pub filter_type: u8,
29 pub block_hash: BlockHash,
31 pub filter: Vec<u8>,
33}
34impl_consensus_encoding!(CFilter, filter_type, block_hash, filter);
35
36#[derive(PartialEq, Eq, Clone, Debug)]
38pub struct GetCFHeaders {
39 pub filter_type: u8,
41 pub start_height: u32,
43 pub stop_hash: BlockHash,
45}
46impl_consensus_encoding!(GetCFHeaders, filter_type, start_height, stop_hash);
47
48#[derive(PartialEq, Eq, Clone, Debug)]
50pub struct CFHeaders {
51 pub filter_type: u8,
53 pub stop_hash: BlockHash,
55 pub previous_filter_header: FilterHeader,
57 pub filter_hashes: Vec<FilterHash>,
59}
60impl_consensus_encoding!(CFHeaders, filter_type, stop_hash, previous_filter_header, filter_hashes);
61
62#[derive(PartialEq, Eq, Clone, Debug)]
64pub struct GetCFCheckpt {
65 pub filter_type: u8,
67 pub stop_hash: BlockHash,
69}
70impl_consensus_encoding!(GetCFCheckpt, filter_type, stop_hash);
71
72#[derive(PartialEq, Eq, Clone, Debug)]
74pub struct CFCheckpt {
75 pub filter_type: u8,
77 pub stop_hash: BlockHash,
79 pub filter_headers: Vec<FilterHeader>,
81}
82impl_consensus_encoding!(CFCheckpt, filter_type, stop_hash, filter_headers);