Skip to content

Commit

Permalink
negentropy: return our version if we are a server and got the wrong v…
Browse files Browse the repository at this point in the history
…ersion (blergh).
  • Loading branch information
fiatjaf committed Sep 20, 2024
1 parent b870a78 commit 0bcefc8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nip77/negentropy/negentropy.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ func (n *Negentropy) reconcileAux(reader *StringHexReader) (string, error) {
return "", fmt.Errorf("failed to read pv: %w", err)
}
if pv != protocolVersion {
return "", fmt.Errorf("unsupported negentropy protocol version %v", pv)
if n.isClient {
return "", fmt.Errorf("unsupported negentropy protocol version %v", pv)
}

// if we're a server we just return our protocol version
return fullOutput.Hex(), nil
}

var prevBound Bound
Expand Down

0 comments on commit 0bcefc8

Please sign in to comment.