Changeset View
Changeset View
Standalone View
Standalone View
src/bloom.cpp
Show First 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
bool CBloomFilter::IsRelevantAndUpdate(const CTransaction &tx) { | bool CBloomFilter::IsRelevantAndUpdate(const CTransaction &tx) { | ||||
bool fFound = false; | bool fFound = false; | ||||
// Match if the filter contains the hash of tx for finding tx when they | // Match if the filter contains the hash of tx for finding tx when they | ||||
// appear in a block | // appear in a block | ||||
if (isFull) return true; | if (isFull) return true; | ||||
if (isEmpty) return false; | if (isEmpty) return false; | ||||
const uint256 &txid = tx.GetId(); | const uint256 &txid = tx.GetHash(); | ||||
if (contains(txid)) fFound = true; | if (contains(txid)) fFound = true; | ||||
for (unsigned int i = 0; i < tx.vout.size(); i++) { | for (unsigned int i = 0; i < tx.vout.size(); i++) { | ||||
const CTxOut &txout = tx.vout[i]; | const CTxOut &txout = tx.vout[i]; | ||||
// Match if the filter contains any arbitrary script data element in any | // Match if the filter contains any arbitrary script data element in any | ||||
// scriptPubKey in tx. If this matches, also add the specific output | // scriptPubKey in tx. If this matches, also add the specific output | ||||
// that was matched. This means clients don't have to update the filter | // that was matched. This means clients don't have to update the filter | ||||
// themselves when a new relevant tx is discovered in order to find | // themselves when a new relevant tx is discovered in order to find | ||||
▲ Show 20 Lines • Show All 163 Lines • Show Last 20 Lines |