Log when a address is black/whitelisted
This commit is contained in:
parent
46ffc2d2df
commit
ba769a8435
@ -130,6 +130,7 @@ func gateway_handler(c net.Conn) {
|
|||||||
func add_to_whitelist(addr string) {
|
func add_to_whitelist(addr string) {
|
||||||
// Add the specified address to the whitelist
|
// Add the specified address to the whitelist
|
||||||
if ! is_whitelisted(addr) {
|
if ! is_whitelisted(addr) {
|
||||||
|
fmt.Println("[OK ] Add ", addr, " to whitelist")
|
||||||
update_whitelist_time(addr)
|
update_whitelist_time(addr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -159,7 +160,10 @@ func is_whitelisted(addr string) bool {
|
|||||||
|
|
||||||
func add_to_blacklist(addr string) {
|
func add_to_blacklist(addr string) {
|
||||||
// Add specified address to blacklist
|
// Add specified address to blacklist
|
||||||
blacklist = append(blacklist, addr)
|
if ! is_blacklisted(addr) {
|
||||||
|
fmt.Println("[OK ] Add ", addr, " to blacklist")
|
||||||
|
blacklist = append(blacklist, addr)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func is_blacklisted(addr string) bool {
|
func is_blacklisted(addr string) bool {
|
||||||
|
Loading…
Reference in New Issue
Block a user