From 19440c1e3936112203545bdf26354f4dd1b8e273 Mon Sep 17 00:00:00 2001 From: Calvin Zachman Date: Mon, 28 Dec 2020 10:04:13 -0600 Subject: [PATCH] ensure 64bit alignment of atomically accessed field in ChannelAcceptor - help lnd avoid a bug in the `sync/atomic` package which requires 64-bit alignment of atomically accessed fields --- chanacceptor/chainedacceptor.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chanacceptor/chainedacceptor.go b/chanacceptor/chainedacceptor.go index e7227b04..cfc87c67 100644 --- a/chanacceptor/chainedacceptor.go +++ b/chanacceptor/chainedacceptor.go @@ -7,12 +7,12 @@ import ( // ChainedAcceptor represents a conjunction of ChannelAcceptor results. type ChainedAcceptor struct { + acceptorID uint64 // To be used atomically. + // acceptors is a map of ChannelAcceptors that will be evaluated when // the ChainedAcceptor's Accept method is called. acceptors map[uint64]ChannelAcceptor acceptorsMtx sync.RWMutex - - acceptorID uint64 // To be used atomically. } // NewChainedAcceptor initializes a ChainedAcceptor.