haskoin / haskoin-core

Haskoin Core is a Bitcoin and Bitcoin Cash library
MIT License
522 stars 94 forks source link

Added bloomRelevantUpdate implementation for bloom filter #376

Closed IlyasRidhuan closed 5 years ago

IlyasRidhuan commented 5 years ago

This adds functionality to update a bloom filter based on the outputs from a tx. If the scriptPubKey of any output is relevant (i.e., any of its data elements are contained in the bloom filter) then an outpoint (comprising the txid and vout) is inserted into the bloom filter. This avoids round-tripping as a result of missing relevant txs (e.g. a tx that spends a previous output).

Tests are based on the bloom_test.cpp from Bitcoin-core but with different transactions as the sigs used in those are high-S which cause decodeStrictSig to fail.