Log when a address is black/whitelisted

This commit is contained in:
maride 2017-09-28 23:30:21 +02:00
parent 46ffc2d2df
commit ba769a8435

View File

@ -130,6 +130,7 @@ func gateway_handler(c net.Conn) {
func add_to_whitelist(addr string) {
// Add the specified address to the whitelist
if ! is_whitelisted(addr) {
fmt.Println("[OK ] Add ", addr, " to whitelist")
update_whitelist_time(addr)
}
}
@ -159,8 +160,11 @@ func is_whitelisted(addr string) bool {
func add_to_blacklist(addr string) {
// Add specified address to blacklist
if ! is_blacklisted(addr) {
fmt.Println("[OK ] Add ", addr, " to blacklist")
blacklist = append(blacklist, addr)
}
}
func is_blacklisted(addr string) bool {
// Check whether or not the specified address is blacklisted