fix setting protocol version for v0 server
authorJoey Hess <joeyh@joeyh.name>
Fri, 26 Jul 2024 17:24:56 +0000 (13:24 -0400)
committerJoey Hess <joeyh@joeyh.name>
Fri, 26 Jul 2024 17:24:56 +0000 (13:24 -0400)
Before it was leaving the protocol version at the default, when it
was actually v0.

v0 has only ever been used over tor, which is probably why this bug was
never noticed.

P2P/Protocol.hs

index eccca1fef715c72080813deced3b8a83fed9ab58..aec03c31572e109dfd511e7d53904e3a1839681b 100644 (file)
@@ -377,7 +377,7 @@ negotiateProtocolVersion preferredversion = do
        case r of
                Just (VERSION v) -> net $ setProtocolVersion v
                -- Old server doesn't know about the VERSION command.
-               Just (ERROR _) -> return ()
+               Just (ERROR _) -> net $ setProtocolVersion 0
                _ -> net $ sendMessage (ERROR "expected VERSION")
 
 sendBypass :: Bypass -> Proto ()