From efe7c76378695393d5da7495662c39192082b93a Mon Sep 17 00:00:00 2001 From: iamsofonias Date: Thu, 6 Jun 2024 14:26:02 -0400 Subject: [PATCH] force-v1-protocol-version-for-outbound-connections --- .DS_Store | Bin 0 -> 10244 bytes lib/remote_node.go | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..1bb220722e7ab5503e45889a6a094a3fc42f3f1c GIT binary patch literal 10244 zcmeHMJ!lj`6n>LCyjx=tNTC>nO{a|}U=c*&3}+<-B_Lvx=SPCkL zLP%{2#Y%#pb}AahRN81Iq%xI=@6F8azS*BkY$U{4*nM~NzBliiZ)WFsa{wSFyOnVO z7Xb2jlN~yQkA#c-bjPj%-7YBhu81< ziH&dE*YJwPQr#FZyd56=diD;Noo^Yg+ybfLtv130(h2+m=7 zZ6tTic}W~1{WQFgNji%2(R&s3a~;}H1`jGwHTj4qIuk>1KA(@G(#!pLA3L zp93(5Y}!zT4zx`+!*7s{;pbc~z6i95U_vHom;@dfC_z2SpoynPpglbIy@yM$&*tRX z2)tp|xYx|r!%nf+GBluKj(GJ)=;8UE9^D*0=jW4geE#EJGv7PPHz;Skj$^Firw+ae z9yFulopREVoX`8iEr0we{c?UgqfNe#iLWF1B17a$&u)b4!1H6tD9-a^Gte!eKhCi~ z(%_dV5WhUVJ;=+$_nKDlyg8GtFVs2Oa<#_!!n@-eK8wEcCk%e;JKe;;j(cVLXho52;mVD778?7`R2!})H1 z82x@*?ddv>^ND+TK5=>-JH>stf%$xGBm3v0XK@72fBF6mU$00%oJTr}^8qod_|RV7 zLQab~w~-z6#3{+gKyW^rD~wMB74B#0D1#4NB0f&A&Svlpq4hUstTpG$)npXswfgh! z*7lbCok{4AYt36W{BhkTi&6c#plwfC8IEx> t9PK~)Gr+G=)k%-7|8c(J6+W*e<6d4r+WH??a}H0s*l7dT2lin7{|DoFnKu9c literal 0 HcmV?d00001 diff --git a/lib/remote_node.go b/lib/remote_node.go index aaa295c6a..fc8b42385 100644 --- a/lib/remote_node.go +++ b/lib/remote_node.go @@ -512,7 +512,7 @@ func (rn *RemoteNode) HandleVersionMessage(verMsg *MsgDeSoVersion, responseNonce } // Verify that the peer's version matches our minimal supported version. - if verMsg.Version < rn.params.MinProtocolVersion { + if verMsg.Version < rn.params.MinProtocolVersion && verMsg.Version != 1 { return fmt.Errorf("RemoteNode.HandleVersionMessage: Requesting disconnect for id: (%v) "+ "protocol version too low. Peer version: %v, min version: %v", rn.id, verMsg.Version, rn.params.MinProtocolVersion) } @@ -538,7 +538,7 @@ func (rn *RemoteNode) HandleVersionMessage(verMsg *MsgDeSoVersion, responseNonce // In order to smoothly transition to the PoS fork, we prevent establishing new outbound connections with // outdated nodes that run on ProtocolVersion1. This is because ProtocolVersion1 nodes will not be able to // validate the PoS blocks and will be stuck on the PoW chain, unless they upgrade to ProtocolVersion2. - if rn.params.ProtocolVersion == ProtocolVersion2 && rn.IsOutbound() { + if rn.params.ProtocolVersion == ProtocolVersion2 && rn.IsOutbound() && verMsg.Version != 1 { return fmt.Errorf("RemoteNode.HandleVersionMessage: Requesting disconnect for id: (%v). Version too low. "+ "Outbound RemoteNodes must use at least ProtocolVersion2, instead received version: %v", rn.id, verMsg.Version) }