mirror of
https://github.com/corda/corda.git
synced 2025-02-20 17:33:15 +00:00
Fixed a bug where if NotaryService.Type is used as an advertised service no notary is created and no obvious error occurs.
This commit is contained in:
parent
9d9164980e
commit
a74c491745
@ -27,7 +27,6 @@ class NodeRunner {
|
||||
companion object {
|
||||
@JvmStatic fun main(arguments: Array<String>) {
|
||||
val cliParams = CliParams.parse(CliParams.parser.parse(*arguments))
|
||||
|
||||
val nodeDirectory = Paths.get(cliParams.baseDirectory)
|
||||
createNodeRunDirectory(nodeDirectory)
|
||||
|
||||
|
@ -256,7 +256,9 @@ abstract class AbstractNode(val dir: Path, val configuration: NodeConfiguration,
|
||||
if (NetworkMapService.Type in serviceTypes) makeNetworkMapService()
|
||||
|
||||
val notaryServiceType = serviceTypes.singleOrNull { it.isSubTypeOf(NotaryService.Type) }
|
||||
if (notaryServiceType != null) makeNotaryService(notaryServiceType)
|
||||
if (notaryServiceType != null) {
|
||||
makeNotaryService(notaryServiceType)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -316,10 +318,14 @@ abstract class AbstractNode(val dir: Path, val configuration: NodeConfiguration,
|
||||
val timestampChecker = TimestampChecker(platformClock, 30.seconds)
|
||||
|
||||
inNodeNotaryService = when (type) {
|
||||
is SimpleNotaryService.Type -> SimpleNotaryService(smm, net, timestampChecker, uniquenessProvider, services.networkMapCache)
|
||||
is ValidatingNotaryService.Type -> ValidatingNotaryService(smm, net, timestampChecker, uniquenessProvider, services.networkMapCache)
|
||||
else -> null
|
||||
SimpleNotaryService.Type -> SimpleNotaryService(smm, net, timestampChecker, uniquenessProvider, services.networkMapCache)
|
||||
ValidatingNotaryService.Type -> ValidatingNotaryService(smm, net, timestampChecker, uniquenessProvider, services.networkMapCache)
|
||||
else -> {
|
||||
throw IllegalArgumentException("Notary type ${type.id} is not handled by makeNotaryService.")
|
||||
}
|
||||
}
|
||||
|
||||
require(inNodeNotaryService != null)
|
||||
}
|
||||
|
||||
protected open fun makeIdentityService(): IdentityService {
|
||||
|
@ -24,6 +24,7 @@ abstract class NotaryService(val smm: StateMachineManager,
|
||||
val timestampChecker: TimestampChecker,
|
||||
val uniquenessProvider: UniquenessProvider,
|
||||
networkMapCache: NetworkMapCache) : AbstractNodeService(net, networkMapCache) {
|
||||
// Do not specify this as an advertised service. Use a concrete implementation.
|
||||
object Type : ServiceType("corda.notary")
|
||||
|
||||
abstract val logger: org.slf4j.Logger
|
||||
|
Loading…
x
Reference in New Issue
Block a user