peer: Remove unused version sent field.

This removes the field that tracks whether the version has been sent
since it is no longer used after the version negotiation was separated
from the main read and write code.
This commit is contained in:
Dave Collins 2017-05-13 03:46:27 -05:00
parent 1ae306021e
commit 8efd6b15ed
No known key found for this signature in database
GPG key ID: B8904D9D9C93D1F2

View file

@ -405,7 +405,6 @@ type Peer struct {
advertisedProtoVer uint32 // protocol version advertised by remote advertisedProtoVer uint32 // protocol version advertised by remote
protocolVersion uint32 // negotiated protocol version protocolVersion uint32 // negotiated protocol version
sendHeadersPreferred bool // peer sent a sendheaders message sendHeadersPreferred bool // peer sent a sendheaders message
versionSent bool
verAckReceived bool verAckReceived bool
knownInventory *mruInventoryMap knownInventory *mruInventoryMap
@ -2017,14 +2016,7 @@ func (p *Peer) writeLocalVersionMsg() error {
return err return err
} }
if err := p.writeMessage(localVerMsg); err != nil { return p.writeMessage(localVerMsg)
return err
}
p.flagsMtx.Lock()
p.versionSent = true
p.flagsMtx.Unlock()
return nil
} }
// negotiateInboundProtocol waits to receive a version message from the peer // negotiateInboundProtocol waits to receive a version message from the peer