diff --git a/blacklist.go b/blacklist.go index 909a1ee..c8784b2 100644 --- a/blacklist.go +++ b/blacklist.go @@ -45,8 +45,9 @@ func NewTimeCachedBlacklist(expiry time.Duration) (Blacklist, error) { func (b *TimeCachedBlacklist) Add(p peer.ID) { b.Lock() + defer b.Unlock() + b.tc.Add(p.String()) - b.Unlock() } func (b *TimeCachedBlacklist) Contains(p peer.ID) bool {