This commit modifies the NewMerkleBlock function to return the matched
transaction indices instead of their hashes. This is being done because
it is much easier for the caller to lookup the matched transactions from
the original passed block based on their transaction index within the
block versus their hashes.
This prevents the caller from being able to accidentally lock or
unlock access to the filter internal state.
While here, remove several defers that do not gain us any readability,
and only hurt our performance.
This commit creates and an example test file that integrates nicely with
Go's example tooling.
This allows the example output to be tested as a part of running the
normal Go tests to help ensure it doesn't get out of date with the code.
This commit finishes the work started by @dajohi on bloom filters.
- Rename the package from bloomfilter to bloom
- Rename New function to NewFiler
- Rename Load function to LoadFilter
- Rename BloomFilter type to Filter
- Rename Contains to Matches
- Correct tx match handling to match all inputs and outputs instead of
only the first one
- Optimize murmur hash function by using constants
- Optimize the merkle block creation and reduce num of memory allocations
required
- Make MsgFilterLoad concurrent safe as intended
- Update various code consistency issues
- Add a lot of comments
- Improve tests
- Make the code golint clean