Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 2,905 Lines • ▼ Show 20 Lines | else if (strCommand == NetMsgType::FILTERLOAD) { | ||||
vRecv >> filter; | vRecv >> filter; | ||||
if (!filter.IsWithinSizeConstraints()) { | if (!filter.IsWithinSizeConstraints()) { | ||||
// There is no excuse for sending a too-large filter | // There is no excuse for sending a too-large filter | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
Misbehaving(pfrom, 100, "oversized-bloom-filter"); | Misbehaving(pfrom, 100, "oversized-bloom-filter"); | ||||
} else { | } else { | ||||
LOCK(pfrom->cs_filter); | LOCK(pfrom->cs_filter); | ||||
delete pfrom->pfilter; | pfrom->pfilter.reset(new CBloomFilter(filter)); | ||||
pfrom->pfilter = new CBloomFilter(filter); | |||||
pfrom->pfilter->UpdateEmptyFull(); | pfrom->pfilter->UpdateEmptyFull(); | ||||
pfrom->fRelayTxes = true; | pfrom->fRelayTxes = true; | ||||
} | } | ||||
} | } | ||||
else if (strCommand == NetMsgType::FILTERADD) { | else if (strCommand == NetMsgType::FILTERADD) { | ||||
std::vector<uint8_t> vData; | std::vector<uint8_t> vData; | ||||
vRecv >> vData; | vRecv >> vData; | ||||
Show All 18 Lines | else if (strCommand == NetMsgType::FILTERADD) { | ||||
// code. We'll go generic. | // code. We'll go generic. | ||||
Misbehaving(pfrom, 100, "invalid-filteradd"); | Misbehaving(pfrom, 100, "invalid-filteradd"); | ||||
} | } | ||||
} | } | ||||
else if (strCommand == NetMsgType::FILTERCLEAR) { | else if (strCommand == NetMsgType::FILTERCLEAR) { | ||||
LOCK(pfrom->cs_filter); | LOCK(pfrom->cs_filter); | ||||
if (pfrom->GetLocalServices() & NODE_BLOOM) { | if (pfrom->GetLocalServices() & NODE_BLOOM) { | ||||
delete pfrom->pfilter; | pfrom->pfilter.reset(new CBloomFilter()); | ||||
pfrom->pfilter = new CBloomFilter(); | |||||
} | } | ||||
pfrom->fRelayTxes = true; | pfrom->fRelayTxes = true; | ||||
} | } | ||||
else if (strCommand == NetMsgType::FEEFILTER) { | else if (strCommand == NetMsgType::FEEFILTER) { | ||||
Amount newFeeFilter = Amount::zero(); | Amount newFeeFilter = Amount::zero(); | ||||
vRecv >> newFeeFilter; | vRecv >> newFeeFilter; | ||||
if (MoneyRange(newFeeFilter)) { | if (MoneyRange(newFeeFilter)) { | ||||
▲ Show 20 Lines • Show All 820 Lines • Show Last 20 Lines |