Skip to content

Commit dddd927

Browse files
author
MarcoFalke
committed
net: Document what happens to getdata of unknonw type
1 parent 8a503a6 commit dddd927

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/net_processing.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,6 +1540,11 @@ void static ProcessGetData(CNode* pfrom, const CChainParams& chainparams, CConnm
15401540
}
15411541
}
15421542

1543+
// Unknown types in the GetData stay in vRecvGetData and block any future
1544+
// message from this peer, see vRecvGetData check in ProcessMessages().
1545+
// Depending on future p2p changes, we might either drop unknown getdata on
1546+
// the floor or disconnect the peer.
1547+
15431548
pfrom->vRecvGetData.erase(pfrom->vRecvGetData.begin(), it);
15441549

15451550
if (!vNotFound.empty()) {
@@ -3219,6 +3224,7 @@ bool PeerLogicValidation::ProcessMessages(CNode* pfrom, std::atomic<bool>& inter
32193224
return false;
32203225

32213226
// this maintains the order of responses
3227+
// and prevents vRecvGetData to grow unbounded
32223228
if (!pfrom->vRecvGetData.empty()) return true;
32233229
if (!pfrom->orphan_work_set.empty()) return true;
32243230

0 commit comments

Comments
 (0)