]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Fix peerExtensionBytes.SetBit
authorMatt Joiner <anacrolix@gmail.com>
Sat, 3 Feb 2018 02:29:48 +0000 (13:29 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Sat, 3 Feb 2018 02:29:48 +0000 (13:29 +1100)
handshake.go

index 60a546208fdfa58f2b4a63cb76b574f808dbddb2..0262e81c67f033e29169678de8c54dab4c94a2ec 100644 (file)
@@ -51,7 +51,7 @@ func (pex peerExtensionBytes) SupportsFast() bool {
 }
 
 func (pex *peerExtensionBytes) SetBit(bit ExtensionBit) {
-       pex[7-bit/8] |= 1 << bit % 8
+       pex[7-bit/8] |= 1 << (bit % 8)
 }
 
 func (pex peerExtensionBytes) GetBit(bit ExtensionBit) bool {