mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-26 01:33:02 +01:00
wtclient: add mutex locking in perUpdate
Lock the `backupMu` when accessing `c.chanCommitHeights` in the `New` function. It is not strictly necessary right now but good to add it so that there is no accidental oversight if the `perUpdate` method is ever extracted and reused in future.
This commit is contained in:
parent
65dc20f2cc
commit
08cde98869
@ -386,6 +386,9 @@ func New(config *Config) (*TowerClient, error) {
|
||||
return
|
||||
}
|
||||
|
||||
c.backupMu.Lock()
|
||||
defer c.backupMu.Unlock()
|
||||
|
||||
// Take the highest commit height found in the session's acked
|
||||
// updates.
|
||||
height, ok := c.chanCommitHeights[chanID]
|
||||
|
Loading…
x
Reference in New Issue
Block a user