Disconnect peers sending wtxidrelay message after VERACK
This commit is contained in:
1 parent
cacd85209e
commit
0e20cfedb7
1 file changed
+6
@@ -2506,6 +2506,12 @@ void ProcessMessage(
|
|||||||
// Feature negotiation of wtxidrelay should happen between VERSION and
|
// Feature negotiation of wtxidrelay should happen between VERSION and
|
||||||
// VERACK, to avoid relay problems from switching after a connection is up
|
// VERACK, to avoid relay problems from switching after a connection is up
|
||||||
if (msg_type == NetMsgType::WTXIDRELAY) {
|
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;
|
||||||
|
}
|
||||||
if (pfrom.nVersion >= WTXID_RELAY_VERSION) {
|
if (pfrom.nVersion >= WTXID_RELAY_VERSION) {
|
||||||
LOCK(cs_main);
|
LOCK(cs_main);
|
||||||
if (!State(pfrom.GetId())->m_wtxid_relay) {
|
if (!State(pfrom.GetId())->m_wtxid_relay) {
|
||||||
|
|||||||
Reference in new issue
Block a user