mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
Move bloom and feerate filtering to just prior to tx sending.
This will avoid sending more pointless INVs around updates, and prevents using filter updates to timetag transactions. Also adds locking for fRelayTxes.
This commit is contained in:
parent
4578215e7f
commit
b559914753
3 changed files with 38 additions and 21 deletions
15
src/net.cpp
15
src/net.cpp
|
|
@ -2071,20 +2071,7 @@ void RelayTransaction(const CTransaction& tx, CFeeRate feerate)
|
|||
LOCK(cs_vNodes);
|
||||
BOOST_FOREACH(CNode* pnode, vNodes)
|
||||
{
|
||||
if(!pnode->fRelayTxes)
|
||||
continue;
|
||||
{
|
||||
LOCK(pnode->cs_feeFilter);
|
||||
if (feerate.GetFeePerK() < pnode->minFeeFilter)
|
||||
continue;
|
||||
}
|
||||
LOCK(pnode->cs_filter);
|
||||
if (pnode->pfilter)
|
||||
{
|
||||
if (pnode->pfilter->IsRelevantAndUpdate(tx))
|
||||
pnode->PushInventory(inv);
|
||||
} else
|
||||
pnode->PushInventory(inv);
|
||||
pnode->PushInventory(inv);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue