From 2ff451f6bc7ffada702339e02eb7e6cccde61b56 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sun, 11 Apr 2021 16:30:47 -0700 Subject: [PATCH] chain: fix alignment of atomic integers in bitcoind conn struct As reported by https://github.com/lightningnetwork/lnd/issues/5196, the new atomic integer isn't properly aligned which can caus panics on 32-bit operating systems.. Tof fix this issue, we move the 64-bit integer to lay after the two 32-bit integers at the top of the struct. --- chain/bitcoind_conn.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chain/bitcoind_conn.go b/chain/bitcoind_conn.go index 0487167..71474c5 100644 --- a/chain/bitcoind_conn.go +++ b/chain/bitcoind_conn.go @@ -91,13 +91,13 @@ type BitcoindConn struct { started int32 // To be used atomically. stopped int32 // To be used atomically. - cfg BitcoindConfig - // rescanClientCounter is an atomic counter that assigns a unique ID to // each new bitcoind rescan client using the current bitcoind // connection. rescanClientCounter uint64 + cfg BitcoindConfig + // client is the RPC client to the bitcoind node. client *rpcclient.Client