mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
[net processing] ignore unknown INV types in GETDATA messages
Co-Authored-By: John Newbery <john@johnnewbery.com>
This commit is contained in:
parent
047ceac142
commit
e257cf71c8
1 changed files with 3 additions and 7 deletions
|
|
@ -1645,18 +1645,14 @@ void static ProcessGetData(CNode* pfrom, const CChainParams& chainparams, CConnm
|
||||||
} // release cs_main
|
} // release cs_main
|
||||||
|
|
||||||
if (it != pfrom->vRecvGetData.end() && !pfrom->fPauseSend) {
|
if (it != pfrom->vRecvGetData.end() && !pfrom->fPauseSend) {
|
||||||
const CInv &inv = *it;
|
const CInv &inv = *it++;
|
||||||
if (inv.type == MSG_BLOCK || inv.type == MSG_FILTERED_BLOCK || inv.type == MSG_CMPCT_BLOCK || inv.type == MSG_WITNESS_BLOCK) {
|
if (inv.type == MSG_BLOCK || inv.type == MSG_FILTERED_BLOCK || inv.type == MSG_CMPCT_BLOCK || inv.type == MSG_WITNESS_BLOCK) {
|
||||||
it++;
|
|
||||||
ProcessGetBlockData(pfrom, chainparams, inv, connman);
|
ProcessGetBlockData(pfrom, chainparams, inv, connman);
|
||||||
}
|
}
|
||||||
|
// else: If the first item on the queue is an unknown type, we erase it
|
||||||
|
// and continue processing the queue on the next call.
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unknown types in the GetData stay in vRecvGetData and block any future
|
|
||||||
// message from this peer, see vRecvGetData check in ProcessMessages().
|
|
||||||
// Depending on future p2p changes, we might either drop unknown getdata on
|
|
||||||
// the floor or disconnect the peer.
|
|
||||||
|
|
||||||
pfrom->vRecvGetData.erase(pfrom->vRecvGetData.begin(), it);
|
pfrom->vRecvGetData.erase(pfrom->vRecvGetData.begin(), it);
|
||||||
|
|
||||||
if (!vNotFound.empty()) {
|
if (!vNotFound.empty()) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue