Skip to content

Commit

Permalink
Hotfix for rare panic caused by uninitialized mutex
Browse files Browse the repository at this point in the history
  • Loading branch information
cjepson committed Feb 18, 2016
1 parent 93408e9 commit 76bd7bd
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions wallet/addresspool.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type addressPool struct {
branch uint32
index uint32
started bool
mutex *sync.Mutex
mutex sync.Mutex
wallet *Wallet
}

Expand Down Expand Up @@ -95,7 +95,6 @@ func (a *addressPool) initialize(branch uint32, w *Wallet) error {
}

a.addresses = make([]string, 0)
a.mutex = new(sync.Mutex)
a.wallet = w
a.branch = branch

Expand Down Expand Up @@ -296,12 +295,6 @@ func (w *Wallet) CloseAddressPools() {
if !w.internalPool.started || !w.externalPool.started {
return
}
if w.internalPool.mutex == nil {
return
}
if w.externalPool.mutex == nil {
return
}

w.internalPool.mutex.Lock()
w.externalPool.mutex.Lock()
Expand Down

0 comments on commit 76bd7bd

Please sign in to comment.