mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
[NOD-135] Even if net params allow unroutable - don't allow local IPs (#262)
This commit is contained in:
parent
4845a7f16c
commit
3f7c73f331
@ -6,9 +6,10 @@ package addrmgr
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/daglabs/btcd/config"
|
||||
"net"
|
||||
|
||||
"github.com/daglabs/btcd/config"
|
||||
|
||||
"github.com/daglabs/btcd/wire"
|
||||
)
|
||||
|
||||
@ -225,7 +226,7 @@ func IsValid(na *wire.NetAddress) bool {
|
||||
// in any reserved ranges.
|
||||
func IsRoutable(na *wire.NetAddress) bool {
|
||||
if config.ActiveNetParams().AcceptUnroutable {
|
||||
return true
|
||||
return !IsLocal(na)
|
||||
}
|
||||
|
||||
return IsValid(na) && !(IsRFC1918(na) || IsRFC2544(na) ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user