mirror of
https://github.com/corda/corda.git
synced 2025-06-17 22:58:19 +00:00
Add a config option to toggle auto IP discovery
This commit is contained in:
@ -169,8 +169,11 @@ open class Node(override val configuration: FullNodeConfiguration,
|
||||
|
||||
private fun getAdvertisedAddress(): HostAndPort {
|
||||
return with(configuration) {
|
||||
val publicHost = tryDetectIfNotPublicHost(p2pAddress.host)
|
||||
val useHost = publicHost ?: p2pAddress.host
|
||||
val useHost = if (detectPublicIp) {
|
||||
tryDetectIfNotPublicHost(p2pAddress.host) ?: p2pAddress.host
|
||||
} else {
|
||||
p2pAddress.host
|
||||
}
|
||||
HostAndPort.fromParts(useHost, p2pAddress.port)
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,8 @@ data class FullNodeConfiguration(
|
||||
val notaryClusterAddresses: List<HostAndPort>,
|
||||
override val certificateChainCheckPolicies: List<CertChainPolicyConfig>,
|
||||
override val devMode: Boolean = false,
|
||||
val useTestClock: Boolean = false
|
||||
val useTestClock: Boolean = false,
|
||||
val detectPublicIp: Boolean = true
|
||||
) : NodeConfiguration {
|
||||
/** This is not retrieved from the config file but rather from a command line argument. */
|
||||
@Suppress("DEPRECATION")
|
||||
|
Reference in New Issue
Block a user