diff options
author | Matt Corallo <git@bluematt.me> | 2012-08-20 21:10:25 -0400 |
---|---|---|
committer | Matt Corallo <git@bluematt.me> | 2013-01-16 12:48:02 -0500 |
commit | 4c8fc1a5885634c3b463d5d44337d81cc5b1456b (patch) | |
tree | afd148bb61784fc11a2e12bac84b46a99d887063 /src/main.cpp | |
parent | b02ddbedcba4f9d86b1aabeb71fe18ec03f9a41a (diff) |
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.
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index abb0174edd..1c1de636a8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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; } |