Manually copy relevant fields in ntfn state copy. (#84)
This makes vet happy by manually copying the notification state fields during the deep copy instead of copying the entire struct which contains an embedded mutex.
This commit is contained in:
parent
f584dbd2e5
commit
2de61b2d9a
1 changed files with 4 additions and 1 deletions
|
@ -47,7 +47,10 @@ func (s *notificationState) Copy() *notificationState {
|
||||||
s.Lock()
|
s.Lock()
|
||||||
defer s.Unlock()
|
defer s.Unlock()
|
||||||
|
|
||||||
stateCopy := *s
|
var stateCopy notificationState
|
||||||
|
stateCopy.notifyBlocks = s.notifyBlocks
|
||||||
|
stateCopy.notifyNewTx = s.notifyNewTx
|
||||||
|
stateCopy.notifyNewTxVerbose = s.notifyNewTxVerbose
|
||||||
stateCopy.notifyReceived = make(map[string]struct{})
|
stateCopy.notifyReceived = make(map[string]struct{})
|
||||||
for addr := range s.notifyReceived {
|
for addr := range s.notifyReceived {
|
||||||
stateCopy.notifyReceived[addr] = struct{}{}
|
stateCopy.notifyReceived[addr] = struct{}{}
|
||||||
|
|
Loading…
Reference in a new issue