mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-03 17:26:57 +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
1 changed files with 3 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue