Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 2,042 Lines • ▼ Show 20 Lines | const std::chrono::seconds mempool_req = | ||||
mempool.RemoveUnbroadcastTx(TxId(inv.hash)); | mempool.RemoveUnbroadcastTx(TxId(inv.hash)); | ||||
} else { | } else { | ||||
vNotFound.push_back(inv); | vNotFound.push_back(inv); | ||||
} | } | ||||
} | } | ||||
} // 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 || | if (inv.type == MSG_BLOCK || inv.type == MSG_FILTERED_BLOCK || | ||||
inv.type == MSG_CMPCT_BLOCK) { | inv.type == MSG_CMPCT_BLOCK) { | ||||
it++; | |||||
ProcessGetBlockData(config, pfrom, inv, connman, interruptMsgProc); | ProcessGetBlockData(config, pfrom, inv, connman, interruptMsgProc); | ||||
} | } | ||||
// 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()) { | ||||
// Let the peer know that we didn't find what it asked for, so it | // Let the peer know that we didn't find what it asked for, so it | ||||
// doesn't have to wait around forever. SPV clients care about this | // doesn't have to wait around forever. SPV clients care about this | ||||
// message: it's needed when they are recursively walking the | // message: it's needed when they are recursively walking the | ||||
// dependencies of relevant unconfirmed transactions. SPV clients want | // dependencies of relevant unconfirmed transactions. SPV clients want | ||||
// to do that because they want to know about (and store and rebroadcast | // to do that because they want to know about (and store and rebroadcast | ||||
▲ Show 20 Lines • Show All 3,436 Lines • Show Last 20 Lines |