mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Let a node opt out of tx invs before we get a their bloom filter
Note that the default value for fRelayTxes is false, meaning we now no longer relay tx inv messages before receiving the remote peer's version message.
This commit is contained in:
@@ -2838,6 +2838,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
|
||||
vRecv >> pfrom->strSubVer;
|
||||
if (!vRecv.empty())
|
||||
vRecv >> pfrom->nStartingHeight;
|
||||
if (!vRecv.empty())
|
||||
vRecv >> pfrom->fRelayTxes; // set to true after we get the first filter* message
|
||||
else
|
||||
pfrom->fRelayTxes = true;
|
||||
|
||||
if (pfrom->fInbound && addrMe.IsRoutable())
|
||||
{
|
||||
@@ -3391,6 +3395,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
|
||||
delete pfrom->pfilter;
|
||||
pfrom->pfilter = new CBloomFilter(filter);
|
||||
}
|
||||
pfrom->fRelayTxes = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -3419,6 +3424,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
|
||||
LOCK(pfrom->cs_filter);
|
||||
delete pfrom->pfilter;
|
||||
pfrom->pfilter = NULL;
|
||||
pfrom->fRelayTxes = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user