From 0bcefc86ef49a87994d2ac587c6da37a325ee13b Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Fri, 20 Sep 2024 17:47:47 -0300 Subject: [PATCH] negentropy: return our version if we are a server and got the wrong version (blergh). --- nip77/negentropy/negentropy.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nip77/negentropy/negentropy.go b/nip77/negentropy/negentropy.go index fcc112e..8de50a6 100644 --- a/nip77/negentropy/negentropy.go +++ b/nip77/negentropy/negentropy.go @@ -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