defer unlocking
This commit is contained in:
parent
677ca1025b
commit
6eeed58a50
|
@ -45,8 +45,9 @@ func NewTimeCachedBlacklist(expiry time.Duration) (Blacklist, error) {
|
||||||
|
|
||||||
func (b *TimeCachedBlacklist) Add(p peer.ID) {
|
func (b *TimeCachedBlacklist) Add(p peer.ID) {
|
||||||
b.Lock()
|
b.Lock()
|
||||||
|
defer b.Unlock()
|
||||||
|
|
||||||
b.tc.Add(p.String())
|
b.tc.Add(p.String())
|
||||||
b.Unlock()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *TimeCachedBlacklist) Contains(p peer.ID) bool {
|
func (b *TimeCachedBlacklist) Contains(p peer.ID) bool {
|
||||||
|
|
Loading…
Reference in New Issue