diff options
| author | Matt Corallo <[email protected]> | 2016-06-21 16:28:38 -0700 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2016-10-17 16:44:57 +0200 |
| commit | fe998e962dc015978f104b782afb7daec3c4d4df (patch) | |
| tree | b9b4c1e3ba1e107db8a0d0f3b3e52ad02c2a3915 /src/main.cpp | |
| parent | Dont remove a "preferred" cmpctblock peer if they provide a block (diff) | |
| download | discoin-fe998e962dc015978f104b782afb7daec3c4d4df.tar.xz discoin-fe998e962dc015978f104b782afb7daec3c4d4df.zip | |
More agressively filter compact block requests
Unit test adaptations by Pieter Wuille.
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp index e27fb1fae..0002a1c08 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4878,7 +4878,7 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam // and we don't feel like constructing the object for them, so // instead we respond with the full, non-compact block. bool fPeerWantsWitness = State(pfrom->GetId())->fWantsCmpctWitness; - if (mi->second->nHeight >= chainActive.Height() - 10) { + if (CanDirectFetch(Params().GetConsensus()) && mi->second->nHeight >= chainActive.Height() - 5) { CBlockHeaderAndShortTxIDs cmpctblock(block, fPeerWantsWitness); pfrom->PushMessageWithFlag(fPeerWantsWitness ? 0 : SERIALIZE_TRANSACTION_NO_WITNESS, NetMsgType::CMPCTBLOCK, cmpctblock); } else @@ -5405,8 +5405,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, return true; } - if (it->second->nHeight < chainActive.Height() - 15) { - LogPrint("net", "Peer %d sent us a getblocktxn for a block > 15 deep", pfrom->id); + if (it->second->nHeight < chainActive.Height() - 10) { + LogPrint("net", "Peer %d sent us a getblocktxn for a block > 10 deep", pfrom->id); return true; } |