defer unlocking

This commit is contained in:
Aarsh Shah 2020-02-05 14:33:20 +05:30
parent 677ca1025b
commit 6eeed58a50
1 changed files with 2 additions and 1 deletions

View File

@ -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 {