You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
becomes 0 when number of elements nElements is 1 and nFPRate is more than 0.03. This causes every pubkeyhash to return True when checked using contains method.
The way the length of the filter is determined using bytearray also causes some problems, for example for some values, say 0.0005 < nFPRate < 0.01 and nElements = 1 when you change nFPRate the length of the filter doesn't change. This means that regardless of the false positive rate, filter length and its construction is the same. This leads to a wrong false positive rate, different than the parameter passed for filter construction.
A possible fix could be to use bitarray instead of bytearray.
The text was updated successfully, but these errors were encountered:
The length of bloom filter as determined in this line
python-bitcoinlib/bitcoin/bloom.py
Line 116 in b5540e8
becomes
0
when number of elementsnElements
is1
andnFPRate
is more than0.03
. This causes every pubkeyhash to returnTrue
when checked usingcontains
method.The way the length of the filter is determined using
bytearray
also causes some problems, for example for some values, say0.0005 < nFPRate < 0.01
andnElements = 1
when you changenFPRate
the length of the filter doesn't change. This means that regardless of the false positive rate, filter length and its construction is the same. This leads to a wrong false positive rate, different than the parameter passed for filter construction.A possible fix could be to use
bitarray
instead ofbytearray
.The text was updated successfully, but these errors were encountered: