13 #define LN2SQUARED 0.4804530139182014246671025263266649717305529515945455
14 #define LN2 0.6931471805599453094172321214581765680755001343602552
34 inline unsigned int CBloomFilter::Hash(
unsigned int nHashNum,
const std::vector<unsigned char>& vDataToHash)
const
46 unsigned int nIndex =
Hash(i, vKey);
48 vData[nIndex >> 3] |= (1 << (7 & nIndex));
57 vector<unsigned char>
data(stream.begin(), stream.end());
75 unsigned int nIndex =
Hash(i, vKey);
77 if (!(
vData[nIndex >> 3] & (1 << (7 & nIndex))))
87 vector<unsigned char>
data(stream.
begin(), stream.
end());
114 for (
unsigned int i = 0; i < tx.
vout.size(); i++)
121 CScript::const_iterator pc = txout.
scriptPubKey.begin();
122 vector<unsigned char>
data;
128 if (data.size() != 0 &&
contains(data))
136 vector<vector<unsigned char> > vSolutions;
149 BOOST_FOREACH(
const CTxIn& txin, tx.
vin)
156 CScript::const_iterator pc = txin.
scriptSig.begin();
157 vector<unsigned char>
data;
163 if (data.size() != 0 &&
contains(data))
175 for (
unsigned int i = 0; i <
vData.size(); i++)
177 full &=
vData[i] == 0xff;
178 empty &=
vData[i] == 0;
const_iterator begin() const
unsigned int Hash(unsigned int nHashNum, const std::vector< unsigned char > &vDataToHash) const
static const unsigned int MAX_BLOOM_FILTER_SIZE
std::vector< unsigned char > vData
Double ended buffer combining vector and stream-like interfaces.
void insert(const uint256 &hash)
bool IsWithinSizeConstraints() const
unsigned int MurmurHash3(unsigned int nHashSeed, const std::vector< unsigned char > &vDataToHash)
opcodetype
Script opcodes.
An input of a transaction.
std::vector< CTxOut > vout
bool contains(const std::vector< unsigned char > &vKey) const
bool Solver(const CScript &scriptPubKey, txnouttype &typeRet, vector< vector< unsigned char > > &vSolutionsRet)
An output of a transaction.
static const unsigned int MAX_HASH_FUNCS
An outpoint - a combination of a transaction hash and an index n into its vout.
bool IsRelevantAndUpdate(const CTransaction &tx, const uint256 &hash)
static const int PROTOCOL_VERSION
bool GetOp(iterator &pc, opcodetype &opcodeRet, std::vector< unsigned char > &vchRet)
The basic transaction that is broadcasted on the network and contained in blocks. ...
static const CCheckpointData data
const_iterator end() const