Skip to content

Commit 164b584

Browse files
committed
fix: only extract handshake version data for NtN
Fixes #129
1 parent e1bb1bd commit 164b584

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

protocol/handshake/client.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,12 @@ func (c *Client) handleAcceptVersion(msgGeneric protocol.Message) error {
6868
}
6969
msg := msgGeneric.(*MsgAcceptVersion)
7070
fullDuplex := false
71-
versionData := msg.VersionData.([]interface{})
72-
//nolint:gosimple
73-
if versionData[1].(bool) == DIFFUSION_MODE_INITIATOR_AND_RESPONDER {
74-
fullDuplex = true
71+
if c.Mode() == protocol.ProtocolModeNodeToNode {
72+
versionData := msg.VersionData.([]interface{})
73+
//nolint:gosimple
74+
if versionData[1].(bool) == DIFFUSION_MODE_INITIATOR_AND_RESPONDER {
75+
fullDuplex = true
76+
}
7577
}
7678
return c.config.FinishedFunc(msg.Version, fullDuplex)
7779
}

0 commit comments

Comments
 (0)