Inserts a transaction and merkle block filter into the receiving peer, overwriting any existing filter the peer has stored for the sender.
This message installs a bloom filter into the peer. Subsequent inv
and merkleblock
messages only provide transactions that in match this bloom filter in some manner. The following items in a transaction are checked against the bloom filter:
If a filtered block is requested via an inventory message, the installed bloom filter is used to choose which transactions are included in the response using the same matching algorithm as described above for transaction inventories.
Field | Length | Format | Description |
---|---|---|---|
bloom filter size | variable | variable length integer | The size of the bloom filter to be used. |
bloom filter data | variable | bloom_filter_size bytes |
Raw bloom filter data (up to 36,000 bytes). |
number of hash functions | 4 bytes | unsigned integer(LE) | The number of hash functions used when generating this filter (max 50). |
tweak | 4 bytes | unsigned integer(LE) | Arbitrary number (nonce) that helps randomize this bloom filter. |
flags | 1 byte | bit field | See bloom filter flags. |
The lowest two bits of flags control how the installed bloom filter is automatically updated. The remaining bits are reserved and should be set to 0.
Value | Name | Description |
---|---|---|
0 | BLOOM_UPDATE_NONE | Do not update the bloom filter |
1 | BLOOM_UPDATE_ALL | Add outpoints to the bloom filter when any of the locking script data elements match the bloom filter |
2 | BLOOM_UPDATE_P2PUBKEY_ONLY | Add outpoints to the bloom filter when any of the locking script data elements match the bloom filter, only when the locking script is a pay-to-public-key or multi-sig script |