diff --git a/server/middleware.go b/server/middleware.go index 36a99a9..f6ebf23 100644 --- a/server/middleware.go +++ b/server/middleware.go @@ -71,6 +71,13 @@ func Authenticate(store peering.Store, key *rsa.PublicKey, funcs ...OptionFunc) return } sendError(w, http.StatusUnauthorized) + case ErrPeerRejected: + if err := store.UpdateLastContact(serverClaims.PeerID, r.RemoteAddr, time.Now()); err != nil { + logger.Printf("[ERROR] %s", err) + sendError(w, http.StatusInternalServerError) + return + } + sendError(w, http.StatusForbidden) default: sendError(w, http.StatusInternalServerError) }