From 010815e2803e0a168e328434b34e732016673373 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sat, 11 Nov 2017 15:50:24 -0800 Subject: [PATCH] lnwallet: no need to grab mutex in ProcessChanSyncMsg as is init method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In this method we fix an existing deadlock within the unit tests when running with the race condition detector on. We don’t need to grab the mutex within the ProcessChanSyncMsg method as this should be the very first method called when initializing the channel if a channel state sync is needed. --- lnwallet/channel.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/lnwallet/channel.go b/lnwallet/channel.go index a366d550..74ab54ab 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -3000,8 +3000,6 @@ func (lc *LightningChannel) SignNextCommitment() (*btcec.Signature, []*btcec.Sig // * RevokeAndAck: if we sent a revocation message that they claim to have // not received func (lc *LightningChannel) ProcessChanSyncMsg(msg *lnwire.ChannelReestablish) ([]lnwire.Message, error) { - lc.Lock() - defer lc.Unlock() // We owe them a commitment if they have an un-acked commitment and the // tip of their chain (from our Pov) is equal to what they think their