From 42ac1879326168b806cb49ee5780cfd23f34fca3 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Thu, 21 May 2020 11:28:49 +0200 Subject: [PATCH] peer: fix struct alignment Integers used atomically MUST be aligned properly, otherwise the sync library will crash on purpose. Therefore non-aligned struct members must come later. --- peer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/peer.go b/peer.go index 4b5d66435..a43f254bb 100644 --- a/peer.go +++ b/peer.go @@ -114,8 +114,6 @@ type peer struct { started int32 disconnect int32 - cfg *Config - // The following fields are only meant to be used *atomically* bytesReceived uint64 bytesSent uint64 @@ -130,6 +128,8 @@ type peer struct { // our last ping message. To be used atomically. pingLastSend int64 + cfg *Config + connReq *connmgr.ConnReq conn net.Conn