mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-14 16:50:17 +02:00
Disconnect peers sending wtxidrelay message after VERACK
This commit is contained in:
committed by
John Newbery
parent
22effa51a7
commit
f082a13ab7
@@ -2213,6 +2213,12 @@ bool ProcessMessage(CNode* pfrom, const std::string& msg_type, CDataStream& vRec
|
||||
// Feature negotiation of wtxidrelay should happen between VERSION and
|
||||
// VERACK, to avoid relay problems from switching after a connection is up
|
||||
if (msg_type == NetMsgType::WTXIDRELAY) {
|
||||
if (pfrom->fSuccessfullyConnected) {
|
||||
// Disconnect peers that send wtxidrelay message after VERACK; this
|
||||
// must be negotiated between VERSION and VERACK.
|
||||
pfrom->fDisconnect = true;
|
||||
return false;
|
||||
}
|
||||
if (pfrom->nVersion >= WTXID_RELAY_VERSION) {
|
||||
LOCK(cs_main);
|
||||
if (!State(pfrom->GetId())->m_wtxid_relay) {
|
||||
|
||||
Reference in New Issue
Block a user