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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
c.backupMu.Lock()
|
||||||
|
defer c.backupMu.Unlock()
|
||||||
|
|
||||||
// Take the highest commit height found in the session's acked
|
// Take the highest commit height found in the session's acked
|
||||||
// updates.
|
// updates.
|
||||||
height, ok := c.chanCommitHeights[chanID]
|
height, ok := c.chanCommitHeights[chanID]
|
||||||
|
|
Loading…
Add table
Reference in a new issue