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,8 +160,11 @@ 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
|
||||||
|
if ! is_blacklisted(addr) {
|
||||||
|
fmt.Println("[OK ] Add ", addr, " to blacklist")
|
||||||
blacklist = append(blacklist, addr)
|
blacklist = append(blacklist, addr)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func is_blacklisted(addr string) bool {
|
func is_blacklisted(addr string) bool {
|
||||||
// Check whether or not the specified address is blacklisted
|
// Check whether or not the specified address is blacklisted
|
||||||
|
Loading…
Reference in New Issue
Block a user