diff --git a/core/src/main/kotlin/net/corda/core/internal/TransactionVerifierServiceInternal.kt b/core/src/main/kotlin/net/corda/core/internal/TransactionVerifierServiceInternal.kt index 82b903817e..826bd92dd6 100644 --- a/core/src/main/kotlin/net/corda/core/internal/TransactionVerifierServiceInternal.kt +++ b/core/src/main/kotlin/net/corda/core/internal/TransactionVerifierServiceInternal.kt @@ -4,7 +4,6 @@ import net.corda.core.DeleteForDJVM import net.corda.core.concurrent.CordaFuture import net.corda.core.contracts.* import net.corda.core.contracts.TransactionVerificationException.TransactionContractConflictException -import net.corda.core.internal.cordapp.CordappImpl import net.corda.core.internal.rules.StateContractValidationEnforcementRule import net.corda.core.transactions.LedgerTransaction import net.corda.core.utilities.contextLogger @@ -37,6 +36,7 @@ class Verifier(val ltx: LedgerTransaction, companion object { private val logger = contextLogger() + private val disableHashConstraints = System.getProperty("net.corda.node.internal.Verifier.disableHashConstraints")?.toBoolean() ?: false } /** @@ -339,9 +339,10 @@ class Verifier(val ltx: LedgerTransaction, val constraintAttachment = AttachmentWithContext(contractAttachment, contract, ltx.networkParameters!!.whitelistedContractImplementations) - if (!constraint.isSatisfiedBy(constraintAttachment)) { + if (disableHashConstraints && constraint is HashAttachmentConstraint) + logger.warn("Skipping hash constraints verification.") + else if (!constraint.isSatisfiedBy(constraintAttachment)) throw TransactionVerificationException.ContractConstraintRejection(ltx.id, contract) - } } } diff --git a/node/src/main/kotlin/net/corda/node/internal/NodeStartup.kt b/node/src/main/kotlin/net/corda/node/internal/NodeStartup.kt index 18268cf1b0..4ffabf2da8 100644 --- a/node/src/main/kotlin/net/corda/node/internal/NodeStartup.kt +++ b/node/src/main/kotlin/net/corda/node/internal/NodeStartup.kt @@ -177,6 +177,11 @@ open class NodeStartup : NodeStartupLogging { logger.info("The Corda node is running in production mode. If this is a developer environment you can set 'devMode=true' in the node.conf file.") } + val disableHashConstraints = System.getProperty("net.corda.node.internal.Verifier.disableHashConstraints")?.toBoolean() ?: false + if (disableHashConstraints) { + Node.printWarning("Hash constraints checking has been disabled by the node operator.") + } + val nodeInfo = node.start() val loadedCodapps = node.services.cordappProvider.cordapps.filter { it.isLoaded } logLoadedCorDapps(loadedCodapps)