From 8efd6b15edfdcb8fa31d7300125658c89d58c98c Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Sat, 13 May 2017 03:46:27 -0500 Subject: [PATCH] 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. --- peer/peer.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/peer/peer.go b/peer/peer.go index d12ddea2..6cfe1738 100644 --- a/peer/peer.go +++ b/peer/peer.go @@ -405,7 +405,6 @@ type Peer struct { advertisedProtoVer uint32 // protocol version advertised by remote protocolVersion uint32 // negotiated protocol version sendHeadersPreferred bool // peer sent a sendheaders message - versionSent bool verAckReceived bool knownInventory *mruInventoryMap @@ -2017,14 +2016,7 @@ func (p *Peer) writeLocalVersionMsg() error { return err } - if err := p.writeMessage(localVerMsg); err != nil { - return err - } - - p.flagsMtx.Lock() - p.versionSent = true - p.flagsMtx.Unlock() - return nil + return p.writeMessage(localVerMsg) } // negotiateInboundProtocol waits to receive a version message from the peer